Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6115871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:08:31+00:00 2026-05-23T15:08:31+00:00

@PostLoad public void initThing() { … } I added that to my entity but

  • 0
@PostLoad 
public void initThing() { ... }

I added that to my entity but it seems on the entity load it’s not called…

I use jpa on a spring context without EJB
Hibernate 3.2.7

We already have some hibernate interceptors (extending EmptyInterceptor) declared inside the “entityInterceptor” of the session factory

Is it possible to mix both styles of interceptor?

Is it possible to use @PostLoad without EJB/EntityManager?

Another reason?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:08:31+00:00Added an answer on May 23, 2026 at 3:08 pm

    For those interested, i got a response from Steve Ebersole and it seems that when you create your own hibernate SessionFactory, you can’t use the JPA annotations like @PostLoad without registering the corresponding EventListener in that session factory…
    Actually the entity manager system do all this stuff for you.

    So i guess i have to add the EJB3PostLoadEventListener to the session factory

    But as in my case i have to make this available just for my subproject, i’ll use an hibernate interceptor because they can be session scoped, and also injected this interceptor in an overriden spring HibernateTemplate declaration

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following class (which is a JPA entity listener): @Service public class
I have several Entity classes. Now I want to use @PostLoad in every entity.
<form method=post action=load_statements.php?action=load id=loadForm enctype=multipart/form-data> that is my form, which looks fine to me.
I just successfully installed WysiHat in my rails blog. Seems that the 'add a
I'm looking for the different ways to map an enum using JPA. I especially
Castle ActiveRecord has BeforeLoad event but I need AfterLoad event too. I know it's
Is it normal for PHP not to decode $_POST sent as application/x-www-form-urlencoded through AJAX?
How do you track the number of times a particular entity (say a user
I'm trying to use Ajax with my CRUD. I'm following this tutorial . I
How can I configure hibernate event listeners post-insert, post-delete, post-load, post-update in java configuration?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.