Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Redefined Default group as sequence?
PostPosted: Mon Feb 23, 2009 11:19 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I am just wondering why the spec uses @GroupSequence to redefine the Default group? Does this not change the semantics of Default? Without redefining the default group all constraints belonging (explicitly or implicitly) to the Default group are evaluated. Once you use @GroupSequence to redefine the default group the semantic changes. Now I stop evaluating once I get a constraint validation in one of the defined default groups. Wouldn't it make sense to evaluate all constraints? In this case we might want another name for this annotation.

This might also remove some ambiguity between @GroupSequence on classes and @GroupSequence on interfaces.

Any thoughts?

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 11:42 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7179
Location: Atlanta, USA
That's the point.
If you are interested in evaluating all constraints wo sequencing constraint, then just mark these constraints as Default.
Redefining Default for a class is really about allowing a sequencing between the class group (ie the default Default) and another set of groups.

Code:
@GroupSequence(Address.class, Address.Heavy)
public class Address {
  @NotNull String street;
  @ZipCode(groups=Address.Heavy) String zipcode;
  public interface Heavy{}
}

_________________
Emmanuel
Check Hibernate Search in Action out


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 12:55 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Right, but should it be called "redefine the default group then"? Shouldn't it be "define a default sequence". Maybe it's just the terminology which gets me.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 1:20 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7179
Location: Atlanta, USA
Well there is no notion of default sequence in the spec, so we can't redefine that :)
But we can change some of the wording if we find something good.

_________________
Emmanuel
Check Hibernate Search in Action out


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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.