-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: New Bug in 5.0.4 while annotating attributes?
PostPosted: Fri Nov 20, 2015 5:18 am 
Newbie

Joined: Thu Oct 29, 2015 5:18 am
Posts: 3
We are using Hibernate with JPA.
We annotate attributes, not methods.

After upgrading from 5.0.3 to 5.0.4 Hibernate crashes with

javax.persistence.PersistenceException: Unable to build entity manager factory
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:66)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at XYZTest.setup(XYZTest.java:35)
Caused by: org.hibernate.boot.MappingException: HHH000474: Ambiguous persistent property methods detected on XYZ; mark one as @Transient : [public java.lang.Boolean XYZ.getUngueltig()] and [public java.lang.Boolean XYZ.isUngueltig()] : origin(XYZ)
at org.hibernate.cfg.PropertyContainer.initProperties(PropertyContainer.java:201)
at org.hibernate.cfg.PropertyContainer.<init>(PropertyContainer.java:83)
at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:217)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:710)
at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:245)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:222)

Application code has not changed for years. Do we now have to annotate methods with @Transient? Up to now we only annotate attributes. Bug or feature?
Thanks a lot!


Top
 Profile  
 
 Post subject: Re: New Bug in 5.0.4 while annotating attributes?
PostPosted: Fri Nov 20, 2015 5:34 am 
Hibernate Team
Hibernate Team

Joined: Sun Jul 17, 2011 9:28 am
Posts: 4
Can you please open a thicket on https://hibernate.atlassian.net providing a test case reproducing the issue?

Thanks a lot


Top
 Profile  
 
 Post subject: Re: New Bug in 5.0.4 while annotating attributes?
PostPosted: Wed Dec 02, 2015 2:18 am 
Beginner
Beginner

Joined: Sat Mar 04, 2006 1:07 am
Posts: 27
I also experienced this with 5.0.4 but it was more of a problem with our code: We had an entity with a Boolean object field ("active") and there were both an isActive() method and a getActive() method. Since the column was declared not null anyway, I just used a boolean primitive and removed the getActive() method. All works fine now.


Top
 Profile  
 
 Post subject: Re: New Bug in 5.0.4 while annotating attributes?
PostPosted: Fri Dec 04, 2015 8:01 am 
Newbie

Joined: Thu Oct 29, 2015 5:18 am
Posts: 3
Yes, same for us, it was the opposite of "clean code", and I "solved" the problem by removing the second method "getUngueltig"...

But I think the problem has been fixed with Hibernate 5.0.5 (HHH-10309)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.