• Post Reply Bookmark Topic Watch Topic
  • New Topic

hbm file <properties> tag

 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?






 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!