-
1. Re: Mapping composite keys
gommo Jul 6, 2005 1:20 AM (in response to doofus)Column name is a class and not a string. i.e.
@EmbeddedId({
@AttributeOverride(name="invoice",column={@Column(name="invoice_id")}),
@AttributeOverride(name="order",column={@Column(name="order_id")})
}) -
2. Re: Mapping composite keys
gommo Jul 6, 2005 1:22 AM (in response to doofus)Sorry, my bad, your not even specifying columns
-
3. Re: Mapping composite keys
elkner Jul 6, 2005 8:01 AM (in response to doofus)NOTE: @EmbeddedId does not take any arguments/parameters in the recent EJB3beta anymore ...
-
4. Re: Mapping composite keys
doofus Jul 10, 2005 8:14 PM (in response to doofus)should the tutorials be updated? i gather many people will use this as a starting point.
also, is there any java doc on this. i searched for a fair while before posting this message, as i had suspicions that it might have been changed in beta 1, yet i could not find whether this was the case, nor any documentation on the persistence libraries. it is also not on the 'migrating to beta 1' wiki entry. that is a little frustrating.
so, now that we have established that they are not part of the standard any more what is the new approach?
lastly, can we have a complete list of what HAS changed since preview 5?
thanks,
-luke -
5. Re: Mapping composite keys
ploskikl Jul 13, 2005 4:45 PM (in response to doofus)I have the exact problem as described at the start of this topic and would also appreciate some help.
I was able to find some documentation for composite keys in Beta 1.
Go to
http://hibernate.org/~emmanuel.doc
and scroll down to section 4.3, Mapping identifier properties
At the end of section 4.3 it says:
You can define a composite primary key through several syntaxes:
- annotate the component property as @Id and make the component class @Embeddable
- annotate the component property as @EmbeddedId
- annotate the class as @IdClass (This mapping is currently not supported by the implementation).
Have a look at Child.java and Parent.java for some examples.
"Child.java" and "Parent.java" are both hyperlinks. However, when I click on either link (in Internet Explorer), I receive
The page cannot be found.
Could some one please fix the links so that we can view the source code?
Thank you very much!
- Karen -
6. Re: Mapping composite keys
epbernard Jul 15, 2005 12:06 AM (in response to doofus)http://annotations.hibernate.org for the up to date doc