• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

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

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic