-->
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: hibernate validator PK @notnull problem
PostPosted: Thu Mar 20, 2014 9:51 pm 
Newbie

Joined: Mon Oct 28, 2013 6:02 am
Posts: 3
hi. I english not well.

I problem hibernate validate use mysql auto increament PK key , insert/delete.

class
@NotNull
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="nCertificationSeq")
private Long certificationSeq;

this case insert problem

class
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="nCertificationSeq")
private Long certificationSeq;

this case delete problem, not validate

Repository code
Set<ConstraintViolation<Certification>> i= validator.validateValue(Certification.class, "certificationSeq", null);
System.out.println(i.size());

please check (i.size() > 0 ) == true ?


Top
 Profile  
 
 Post subject: Re: hibernate validator PK @notnull problem
PostPosted: Mon Mar 31, 2014 4:44 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

I'm not exactly understanding your question. Is it, that no validation takes place upon deleting an entity? If so, you can configure this in your persistence.xml by specifying the validation group to be using during the delete lifecycle event (by default, only upon inserts and updates a validation of JPA entities is performed). Otherwise an example of what you think should happen would help to understand the issue you're facing.

Hth,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


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.