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.  [ 2 posts ] 
Author Message
 Post subject: Issues with Hibernate 5.2.9 Session contains method
PostPosted: Sat Apr 22, 2017 5:43 am 

Joined: Thu Apr 20, 2017 4:43 am
Posts: 1
We have migrated from 5.1.0.Final to Hibernate 5.2.9.Final

We are facing one issue with the sessionImpl.contains method
In our application, we works with entity name concepts.
Following is the hbm mapping
<class name="com.test.Employee" table="employee" entity-name="com_test_employee">

The issue with the Hibernate 5.2.9.Final is that when
SessionImpl.contains(Object object)is getting called there is one additional line of code
getSessionFactory().getMetamodel().entityPersister( object.getClass() );
(line number 2018 ) which was not there in 5.1.0 also gets invoked.
And for us always throws IllegalArgumentException saying
"Not an entity com.test.Employee"

Due to technical reasons we cannot change the entity name to "com.test.Employee".
We cannot always call the contains(String entityName, Object object) as
sometimes this contains method gets called from
1)sessionimpl.lock(Object entity, LockModeType lockModeType, Map<String, Object> properties)

We also have configured Hibernate Envers and AuditProcess.getCurrentRevisionData internally calls session.contains(object) method.
Can anyone please suggest how this can be solved.

 Post subject: Re: Issues with hibernate5.2.9 sesionimpl.contains method
PostPosted: Tue May 02, 2017 10:59 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
I added this test case to Hibernate core and everything works just fine. Send me a Pull Request with a modification that replicates your use case to see what's not working for you.

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.