MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
gemino
Post subject: whats the advantage of unique="true" in mapping fi  PostPosted: Feb 06, 2005 - 01:37 PM
Veteran Member
Veteran Member


Joined: Dec 26, 2004
Posts: 17

when i generate the mapping files and some of my attributes in the database are unique there is no unique="true" attribute set in the mapping files. i think it works also without this flag, but whats the advantage of setting this optionally as menshioned in the hibernate docs?

the code looks like this:
Code:
<property name="serialNumber" unique="true" type="java.lang.String" column="SERIAL_NUMBER"/>


is it better than this:
Code:
<property name="serialNumber" type="java.lang.String" column="SERIAL_NUMBER"/>

if there the serialNumber is already set unique in the database itself?
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Feb 06, 2005 - 02:37 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23824

Moving to OT > Soft Dev, this is a hibernate question.


AFAIK this just allows Hibernate to do some more strict checking for you and possibly optimize the use of the this unique object. I think along the lines of how not-null works as well.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits