-->
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: Enforcing validation with access to the session?
PostPosted: Fri Aug 05, 2005 7:52 pm 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
Is there ANY way to enforce a validation rule before execution of SQL queries that will still allow you access to the session (so you can perform queries, for example)?

I've been searching for a way to do this that is consistent for both save and update and I can't seem to find a good way to manage it.

I've had a look at ILifecycle and that seems like it will work for save and delete but onUpdate is not consistently called (for cascaded updates for example). :(

I've taken a look at IInterceptor but it seems that this will only allow access to the pipeline without providing access to the session. :?

Am I missing something? Has someone out there done what I'm trying to do and can provide some guidance?

Cheers,

Symon.

P.S. I'm more than happy for someone to give me a hint on how to hack the SessionImpl.cs to cause OnUpdate to be raised for cascaded updates or change Validate on IValidatable to be passed the session... :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 20, 2005 12:37 pm 
Beginner
Beginner

Joined: Thu May 12, 2005 2:14 am
Posts: 33
Location: Sweden, Sk
Hi

I'm also looking for a way to do this.

Any ideas?

In my example I need to check that a string is unique for the object, I guess that this kind of validation isnt unique, but I cant find the "best practise" to do this.


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.