What does @AttributeOverride mean?(@AttributeOverride 是什么意思?)
问题描述
我目前正在(回来)加快使用 EJB 的速度,而当我离开时,它发生了巨大的变化(到目前为止更好).但是,我遇到了一个我正在努力解决的概念,并且希望更好地理解它,因为它似乎在我们(我工作的地方,而不是我和我脑海中的所有声音)的代码中使用了很多.
I'm currently coming (back) up to speed with EJB and while I was away it changed drastically (so far for the better). However, I've come across a concept that I am struggling with and would like to understand better as it seems to be used in our (where I work, not me and all the voices in my head) code quite a bit.
这是我在一本书中找到的示例.它是展示如何使用 @EmbeddedId 注释的示例的一部分:
Here's the example I've found in a book. It's part of an example showing how to use the @EmbeddedId annotation:
@Entity
public class Employee implements java.io.Serializable
{
@EmbeddedId
@AttributeOverrides({
@AttributeOverride(name="lastName", column=@Column(name="LAST_NAME"),
@AttributeOverride(name="ssn", column=@Column(name="SSN"))
})
private EmbeddedEmployeePK pk;
...
}
EmbeddedEmployeePK 类是一个相当简单的 @Embeddable 类,它定义了一对 @Columns:lastName和 ssn.
The EmbeddedEmployeePK class is a fairly straightforward @Embeddable class that defines a pair of @Columns: lastName and ssn.
哦,我从 Rubinger & 的 O'Reilly 的 Enterprise JavaBeans 3.1 中提取了这个示例.伯克.
Oh, and I lifted this example from O'Reilly's Enterprise JavaBeans 3.1 by Rubinger & Burke.
提前感谢您能给我的任何帮助.
Thanks in advance for any help you can give me.
推荐答案
也就是说,构成嵌入 id 的属性可能已经预定义(通过显式或隐式映射)列名.通过使用 @AttributeOverride,您的意思是忽略关于它存储在哪一列的其他信息,并使用我在此处指定的信息".
It's saying that the attributes that make up the embedded id may have predefined (through explicit or implicit mappings) column names. By using the @AttributeOverride you're saying "ignore what other information you have with regard to what column it is stored in, and use the one I specify here".
这篇关于@AttributeOverride 是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:@AttributeOverride 是什么意思?
基础教程推荐
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- JPA惰性列表上的流 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- 将 double 转换为 Int,向下舍入 2022-01-01
