Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic hibernate code explanation

 
ashwin bala
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

 
David Newton
Author
Rancher
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
Rancher
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.
 
Ryann Ong
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic