aspose file tools*
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hbm file <properties> tag" Watch "hbm file <properties> tag" New topic
Author

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,

ID ISBN TITLE AUTHOR PAGECOUNT COPYRIGHT COST
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?







Thanks,
Shailesh
 
Don't get me started about those stupid light bulbs.
 
subject: hbm file <properties> tag