• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generator class for id type String

 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

My DB table consists of String id.. and in the mapping file, whats the generator class is used for ?
and one more basic doubt ! "The no.of properties of POJO should match with no.of columns in the DB ?" or the columns can be selective in hbm file ? because DB table consists of 10 columns and my login POJO consists of only 2 columns with String ID as one property ..

 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
generator class is used to generate the sequence mapped column values . For eg. Primary key in Employee table is Sequence based.
So you will define id attribute in Employee Entity and govern it by generator class .

You can selectively have few columns than in Table in your entity bean definition. Both counts are not required to be matching or same.
Thanks
 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for reply kilal..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic