Meaningless Drivel is fun!
The moose likes Object Relational Mapping and the fly likes hbm file <properties> tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hbm file <properties> tag" Watch "hbm file <properties> tag" New topic

hbm file <properties> tag

Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Hi Ranchers,

below is my hbm file & main class for inserting records in table,

when I execute program first time, then it will insert record in table successfully. when I try to run second time give exception for isbn column as it is a natural-key in hbm that is fine, then I changed value of isbn code in program then records inserted successfully.
below is records from DB,

6 00983020211 Learning is Fun1! No Idea! 200 0 29.899999618530273
7 00983020212 Learning is Fun1! No Idea! 200 0 29.899999618530273

as in hbm file title & author is declared in tag <properties> with unique attribute a true & name=combo , but still I am able to insert same value in title & author column? and in Books pojo I am getting value of combo as null. I am not sure is we got populated a combo value with title & author with some separator.

is anybody have idea about <properties> tags functionality?

wood burning stoves
subject: hbm file <properties> tag
It's not a secret anymore!