Forums Register Login

generator class for id type String

+Pie Number of slices to send: Send
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 ..

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
thanks for reply kilal..
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 810 times.
Similar Threads
storing an objcet with only selected columns
what i will use in hbm when we use sequence at backend side ?
Parent-Child Relationship Problem
Designing in Hibernate
hibernate mapping problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:34:46.