wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hbm file <properties> tag
 
Similar Threads
How to insert using hibernate?
Data is not inserting
about Hibernate
Collection Mapping
many-one association