This content has been marked as final.
Show 1 reply
-
1. Re: Is there an equivalent annotation for composite-element
ajwhitney Nov 10, 2005 4:29 PM (in response to ajwhitney)An example is this collection of street addresses on a contact. The street address is marked as @Embeddable and has an owner property in addition to the regular address-related properties
@OneToMany(targetEntity = StreetAddress.class, cascade = CascadeType.ALL)
@IndexColumn(name = "COL_INDEX")
@JoinTable(
table = @Table(name="TBL_STREET_ADDRESS"),
joinColumns = @JoinColumn(name="COL_OWNER")
)
private List streetAddresses = new ArrayList();
How should the owner property on StreetAddress be declared so COL_OWNER is mapped to the owner property? Is there something else that should be done for the collection defined above?