-->
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.  [ 3 posts ] 
Author Message
 Post subject: Validator: using objects that aren't yours
PostPosted: Mon Oct 18, 2010 12:50 pm 
Newbie

Joined: Wed Sep 10, 2008 2:31 pm
Posts: 16
While I'm creating this object model I ran into an issue.

I'm using Liferay and they have their own user object. This user object does not contain hibernate validation (and it shouldn't). What would be the most appropriate design decision to add validation into the application?

So far it has been using a facade to add the validation parameters onto the getters. It just seems like it gets overbearing and big, does anyone else have a better way to add validation onto objects that you don't have control over?

I guess I could make a translation service/object to go back and forth between the two? Haven't tried it yet, but maybe it would feel less complicated.


Top
 Profile  
 
 Post subject: Re: Validator: using objects that aren't yours
PostPosted: Fri Oct 22, 2010 9:36 am 
Hibernate Team
Hibernate Team

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

so your problem is that you cannot place validation annotations onto the entities, right? Have you considered xml configuration? This allows you to add constraints to classes you cannot modify.

--Hardy


Top
 Profile  
 
 Post subject: Re: Validator: using objects that aren't yours
PostPosted: Fri Oct 22, 2010 10:06 am 
Newbie

Joined: Wed Sep 10, 2008 2:31 pm
Posts: 16
*clap clap clap* :$

You know, for some reason that never crossed my mind. Ofcourse we can use something else besides annotations when the process calls for it. Down with annotations, long live the xml file!

Thanks a bunch yo.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.