Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Basic hibernate code explanation  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean for first table is,


the bean for next table is


the Employee.hbm.xml file is


the java file is



now can you please tell me what are the columns in the first and second table?
and also tell why emp_id is not filled but address and country are filled ?

i have implement hibernate in my application. help me with this issue.
Thanks in advance

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to do with Spring, moving to ORM.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The columns are listed in your Hibernate mapping. IDs are usually generated--see the <generator> tag?

I'd suggest taking a step back and reading some Hibernate documentation and going through a tutorial or two before trying to proceed much further.
 
Greenhorn
Posts: 19
Fedora Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashwin,

David is correct, Hibernate has its own feature of handling IDs by using the <generator> tag. The <generator> tag creates an identification for each Java class to generate unique identifiers for persistent class.

Here is a good link about Hibernate: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/mapping.html#mapping-declaration-id

 
Normally trees don't drive trucks. Does this tiny ad have a license?
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!