aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Identity issue for EJB3.0 Entity along with Hibernate HBM configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Identity issue for EJB3.0 Entity along with Hibernate HBM configuration" Watch "Identity issue for EJB3.0 Entity along with Hibernate HBM configuration" New topic
Author

Identity issue for EJB3.0 Entity along with Hibernate HBM configuration

Bhavesh Dak
Ranch Hand

Joined: Jun 27, 2009
Posts: 93
Hello Ranchers,

I came across a scenario where I have to user Hibernate hbm files along with Annotated EJB3.0 Entity Beans where I am facing an issue while retrieving entity configured as hbm file.

Issue : The identity value of the entity is coming with default '0' value set where actual value of id should be primary key value stored in database.

For understanding it well please refer following code:

Annotated abstract Entity:



Entity Configured via hbm file :



Hbm Configuration file : "device.hbm.xml"



I am using stateless session beans for implementation of service and dao layers.

following is the code through which I am trying to fetch an instance of Device.



Problem: Code mentioned above works fine but the id value doesn't populate properly and come up as default '0' value.
Can anybody figure it out why it is happening?

Regards,
Bhavesh Shah

SCJP 6(83%), SCWCD 5.0(100%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Identity issue for EJB3.0 Entity along with Hibernate HBM configuration