• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in mapping .

 
ravs jrk
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to hibernate. can somebody help me in solving the problem.


I have two tables.

emp(id (primary key) , name);

department( emp(id)(prmary key), name);

how to map these tables in hbm.xml files.

i.e in mapping DEPARTMENT table, how can i generate the primary key.

using <ID> tag.

thanks
ravs
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi


check out http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-declaration-id

the primary key is generated trough a generator (you can pick from several generators: sequence, hilo, uuid, native, ...).


k
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic