Hi Folks,
First off, I'm using JBoss 4.0.4-GA (upgrading from 4.0.3SP1 + EJB3 RC5)
It appears that the GenericGenerator / PrimaryKeyJoinColumn workaround no
longer works.
This was a work around I found on these message boards (and has been working
for us in production for a while).
Basic idea is we have an OWNER table with OWNER_ID as a column
the other table is EMPLOYMENT with OWNER_ID as its primary key
Ultimately we wanted to have Employment::getOwner() to be the PK field, but due
to a limitation (either in the spec or the implementation, not sure) you
couldn't have a bi-directional @OneToOne relationship where the PK of the child
table was the parent table's ID.
Is the workaround no longer needed? I'll try to test, just thought I'd check
here since it will take a while to convert all my code.
The problem occuring now is:
| org.hibernate.AnnotationException: Unknown mappedBy in:
com.ezOptions.account.Owner.employment, referenced by property unknown:
com.ezOptions.account.Employment.owner
|
| Emitted by: OneToOneSecondPass::doSecondPass(line 127)
|
|
example:
| Owner{
| @OneToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL,
mappedBy="owner"
| public Employment getEmployment() { return employment; }
| }
|
and
| Employment {
| @Id
| @GenericGenerator(name="fk", strategy="foreign", parameters={
| @Parameter(name="property", value="owner")
| })
| @GeneratedValue(strategy=GenerationType.AUTO, generator="fk")
| @Column(name="owner_id")
| public Long getId(){ return id; }
|
| @OneToOne
| @PrimaryKeyJoinColumn
| public AccountOwner getOwner(){ return owner; }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945776#3945776
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945776
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user