-->
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: Inheritance and overrides in xml constraint-mappings(on one
PostPosted: Fri Nov 16, 2012 1:07 pm 
Newbie

Joined: Fri Nov 16, 2012 12:57 pm
Posts: 1
Hi,

in the Hibernate validator Reference manual (chapter 4.2 - Mapping constraints) there is a warning:
Quote:
Warning

A given entity can only be configured once across all configuration files. If the same class is configured more than once an exception is thrown.


Is there any way around this?

I'm trying to provide support for one large "common" configuration and lots of short "customer specific" configurations, and i would like to be able to override (mostly add) constraints to one class.

Is it maybe possible to load (parse) two different constraint mappings and then merge them into one?

Kind regards,
Tomas


Top
 Profile  
 
 Post subject: Re: Inheritance and overrides in xml constraint-mappings(on one
PostPosted: Fri Nov 16, 2012 3:38 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
No, there's no way around this restriction, this behavior is defined by the Bean Validation specification.

You could try to merge your mapping files yourself - e.g. using XSLT - and then pass that combined mapping to Hibernate Validator.

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.