aspose file tools*
The moose likes Object Relational Mapping and the fly likes Basic hibernate code explanation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Basic hibernate code explanation" Watch "Basic hibernate code explanation" New topic
Author

Basic hibernate code explanation

ashwin bala
Ranch Hand

Joined: Dec 07, 2009
Posts: 38
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

Joined: Sep 29, 2008
Posts: 12617

Nothing to do with Spring, moving to ORM.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 24, 2010
Posts: 19

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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic hibernate code explanation