If it won't find the @GeneratedValue annotation maybe you're using an older
version of EJB3. I'm using the latest EJB3 RC5 with the latest hibernate and it
works.
You also have to tell hibernate which property maps the relationship so I guess
in your case it would be something like this (in the child class):
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO, generator="fk1")
| @GenericGenerator(name="fk1", strategy="foreign",
| parameters = [EMAIL PROTECTED](name = "property", value = "parent")})
| public Integer getId() {
|
| ...
|
| @OneToOne(mappedBy = "child")
| public Parent getParent() {
|
| ...
|
|
...assuming you have a "child" relationship in the parent class.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3924021#3924021
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3924021
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user