[jboss-user] [JBoss Tools] - Re: JPA 2.0 mapping giving me an error in Eclipse/JBoss Tools?

Karsten Wutzke do-not-reply at jboss.com
Wed Apr 27 14:11:28 EDT 2011


Karsten Wutzke [http://community.jboss.org/people/kwutzke] created the discussion

"Re: JPA 2.0 mapping giving me an error in Eclipse/JBoss Tools?"

To view the discussion, visit: http://community.jboss.org/message/602329#602329

--------------------------------------------------------------
Sorry for the delay, I needed to create an SSCCE.

Before I continue: does JPA (Hibernate) allow references to non-primary key columns? Zip.country is such a case: Countries.iso_code is not null and has a unique constraint.

I reduced my original app to those four classes plus an HSQL DB test case using Hibernate 3.6. I get the following exception:


Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: geoareas] Unable to configure EntityManagerFactory
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:374)
    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
    at tld.geoareas.Main.main(Main.java:45)
Caused by: org.hibernate.MappingException: property [_tld_geoareas_bbstats_model_Zip__identifierMapper.country] not found on entity [tld.geoareas.bbstats.model.Country]
    at org.hibernate.mapping.PersistentClass.getRecursiveProperty(PersistentClass.java:378)
    at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:414)
    at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:115)
    at org.hibernate.cfg.Configuration.processEndOfQueue(Configuration.java:1550)
    at org.hibernate.cfg.Configuration.processFkSecondPassInOrder(Configuration.java:1473)
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1389)
    at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1345)
    at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1477)
    at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1096)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:278)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:362)
    ... 4 more
Caused by: org.hibernate.MappingException: property [_tld_geoareas_bbstats_model_Zip__identifierMapper.country] not found on entity [tld.geoareas.bbstats.model.Country]
    at org.hibernate.mapping.PersistentClass.getRecursiveProperty(PersistentClass.java:424)
    at org.hibernate.mapping.PersistentClass.getRecursiveProperty(PersistentClass.java:375)
    ... 15 more

Is this a Hibernate bug? I'm wondering about the "recursive property" here...

Karsten

PS: the answer over at SO wasn't helpful (yet).
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/602329#602329]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110427/fe2345d0/attachment.html 


More information about the jboss-user mailing list