[jboss-user] [EJB 3.0] - @UniqueConstraint has no Effect in MQSQL

micho do-not-reply at jboss.com
Wed Feb 21 05:01:35 EST 2007


Hi,

I definde an entitybean with a uniqueConstraint like this

  | @Table
  | (name="usergroup",
  |    uniqueConstraints = {@UniqueConstraint(columnNames={"mandantID", "name"})}
  | )
  | public class BenutzerGruppe implements Serializable
  | {  private long mSid;
  |     private long mMandantID;
  |     private String mName;

I cannot see any effect in the database and it is possible to insert entities which violates the constraint.

I´m using  MySQL 5.0.24a

Do I have to do anything more than using the annotaion in the entitybeandefinition?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019802#4019802

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019802




More information about the jboss-user mailing list