I'm really new to Hibernate and currently upgrading Hibernate from 4.1.9 to 4.3.5. Here is the list of existing hibernate jars:
antlr-2.7.7.jar,hibenate-commons-annotations-4.0.1.Final.jar ,hibernate-core-4.1.9.Final.jar ,hibernate-jpa-2.0-api-1.0.1.Final.jar ,javassist-3.17.1-GA.jar ,jboss-logging-3.1.0.GA.jar,jboss-transaction-api_1.1_spec-1.0.0.Final.jar
I've replaced these jars with the latest Hibernate jars. Here is the list:
antlr-2.7.7.jar,hibernate-commons-annotations-4.0.4.Final.jar,hibernate-core-4.3.5.Final.jar,hibernate-jpa-2.1-api-1.0.0.Final.jar,javassist-3.18.1-GA.jar,jboss-logging-3.1.3.GA.jar,jboss-transaction-api_1.2_spec-1.0.0.Final.jar
After replacing the jars I get a compilation error, and I've changed the below code to fix the issue:
/* Existing code */ ServiceRegistry serviceRegistry = new ServiceRegistryBuilder() .applySettings(config.getProperties()) .buildServiceRegistry();
/* Modified code */ ServiceRegistry serviceRegistry = new ServiceRegistryBuilder() .applySettings(config.getProperties()) .build(); Issue: As I run my application one of the operations is getting an empty HashSet, whereas with the earlier version of the Hibernate jars it was getting a PersistentSet. I'm checking if the object is empty or not. With the PersistentSet it clears the check, but with the HashSet it fails the check for the same data.
Is there anything else I need to do this upgrade? Is there anything which I need to change to handle this kind of situation while doing this upgrade?
The application is using Hibernate mapping. Here is the mapping for the set I was talking about above:
<set name="Code" cascade="all-delete-orphan" inverse="true" where="created_date=(select max(c.created_date) from dma_step_code c where c.step_id=step_id)"> <key column="step_id"/> <one-to-many class="com.hp.dma.data.action.SOPActionCode" /> </set>
|