Thanks for the quick reply. It still doesn't seem to work though.
Now the problem is on the other side of the relationship
It seems as though the @OneToOne marked parent field is not considered when
looking up the @OneToOne(mappedBy="") on the child
I've looked over your response several times to make sure I'm not missing
something. But for the life of me I can't see how my code is different.
In case it matters, I do not actually need the Id field in the child. But as I
read back in Feb on these boards, PK/FK mapping wasn't implemented yet and I
don't think I've seen it go by in the release notes since then.
The only reason I have getId() in the child class is so i can use the
GenericGenerator thing to get at the parent object.
I've tried skipping this one by removing the parent object reference and just
using Id in the child to see if it was some odd bug with the fact that the
child is AccountEntity but the parent calls it Entity, but that just moved the
problem to the next class in the system.
(copying from src/log now, so class names are different)
log entry
| 14:42:27,259 WARN [ServiceController] Problem starting service
persistence.units:unitName=auth
| org.hibernate.AnnotationException: Unknown mappedBy in:
com.ezOptions.account.dao.AccountEntity.account, referenced property unknown:
com.ezOptions.account.dao.EZAccount.entity
| at
org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:127)
| at
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1049)
|
|
Relevant part of EZAccount (parent)
| @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
| @PrimaryKeyJoinColumn
| public AccountEntity getEntity() {
| return entity;
| }
|
| public void setEntity(AccountEntity entity) {
| this.entity = entity;
| }
|
Relevant part of AccountEntity (child)
| @Id
| @GenericGenerator(name = "fk", strategy = "foreign", parameters = {
| @Parameter(name = "property", value = "account")
| })
| @GeneratedValue(strategy = GenerationType.AUTO, generator = "fk")
| @Column(name = "ezaccount_id")
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
| @OneToOne(mappedBy = "entity")
| public EZAccount getAccount() {
| return account;
| }
|
| public void setAccount(EZAccount account) {
| this.account = account;
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945848#3945848
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945848
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user