我目前正在(回来)加快使用 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 是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)