-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: @UniqueConstraint purpose
PostPosted: Wed Aug 26, 2015 4:14 am 
Newbie

Joined: Wed Aug 26, 2015 3:31 am
Posts: 1
Hi all,
I have started working on Hibernate recently ,
I'm trying to understand what is the purpose of @UniqueConstraint , I have a unique constraint on mysql and i can get the errors from mysql.
What the @UniqueConstraint gives me? even if I applies it, still I need to trip to db.

It would be great if someone explain the advantages of this annotation.

10x ahead.


Top
 Profile  
 
 Post subject: Re: @UniqueConstraint purpose
PostPosted: Wed Aug 26, 2015 5:40 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
it is used during the generation/update of the tables.
Hibernate (or the JPA implementation) needs to know which additional constraints are required.

Not sure if it used in some other cases.

Cheers,
Davide


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.