-->
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.  [ 4 posts ] 
Author Message
 Post subject: use interceptor for convert entity object's values after loa
PostPosted: Thu May 26, 2005 5:02 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
can use interceptor for convert entity object's values after loaded?

I want to use hibernate's interceptor to convert the string encoding
before be shown to user and before be saved.


is it possible?

how to ?

and I didn't find the method on just after a object initialized

_________________
I am the creatxr of world.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 1:46 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
interceptor: Allows user code to inspect and/or change property values.
docs http://www.hibernate.org/156.html and
http://www.hibernate.org/hib_docs/api/net/sf/hibernate/Interceptor.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 2:32 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
I 'm sorry.


the method :
onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
Called before an object is saved.

is one of what I want.

but I didn't find the other.

onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
Called just before an object is initialized.

that isn't what I want.

I want "Called just after an object is initialized."

is there the method?

_________________
I am the creatxr of world.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 9:42 am 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
afterload not found...
but...

you can use instantiate and create class with necessary code.


Code:
class a{

property encoded;
}
class b extends a{
property encoded
getproperty encoded{return decode(encoded );}
}

in instantiate create class b.


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