-->
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: @PostLoad not getting called
PostPosted: Wed Mar 23, 2011 5:13 am 
Newbie

Joined: Thu Mar 17, 2011 5:31 am
Posts: 7
Hi,

I have a entity defined with JPA annotations (field level access).

I have also defined a @PostLoad method inside the SAME Pojo class mapped with JPA. Am using Eager fetching for all fields.

But, the @PostLoad method is not getting called, when i am doing a Criteria.list() for the entity.

Is there any other setting which has to be done? i am not using any XML mapping...

Regards,
Pravin


Top
 Profile  
 
 Post subject: Re: @PostLoad not getting called
PostPosted: Wed Mar 23, 2011 5:56 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
do you use the entityManager (through persistence.xml) or a pure hibernate configuration?

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject: Re: @PostLoad not getting called
PostPosted: Wed Mar 23, 2011 6:08 am 
Newbie

Joined: Thu Mar 17, 2011 5:31 am
Posts: 7
mmerder wrote:
do you use the entityManager (through persistence.xml) or a pure hibernate configuration?


Hi,

Am using Spring + hibernate.

Am using Spring XML files to specify hibernate configuration.

Regards,
Pravin


Top
 Profile  
 
 Post subject: Re: @PostLoad not getting called
PostPosted: Wed Mar 23, 2011 6:51 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
PostLoad only works if you use a JPA configuration. So I'd recommend to use JPA. Otherwise have a look at interceptors and events.

_________________
-----------------
Need advanced help? http://www.viada.eu


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.