Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

PostLoad not always called #6

Closed
davidbuccola opened this issue Aug 31, 2011 · 5 comments
Closed

PostLoad not always called #6

davidbuccola opened this issue Aug 31, 2011 · 5 comments

Comments

@davidbuccola
Copy link

I am working with a slightly more advanced object that requires a @PostLoad method. I found that the JPA adapter is not reliably calling the method annotated with @PostLoad. The method gets called if the object is explicitly loaded but not if the object is implicitly loaded.

This works:

author = entityManager.find(Author.class, authorId);  // The @PostLoad method gets called for author

This does NOT work:

book = entityManager.find(Book.class, bookId);
author = book.getAuthor(); // The @PostLoad is NOT called for author

P.S. - Yes, the Book and Author class have a relationship defined between them.

@naaman
Copy link

naaman commented Nov 3, 2011

David,
Do you have a reproducible case for this? Can you post the code in a public repo?

@davidbuccola
Copy link
Author

Let me dig it up. It's been a while since I worked on this.

  • Dave

On Wed, Nov 2, 2011 at 10:14 PM, naaman <
reply@reply.github.com>wrote:

David,
Do you have a reproducible case for this? Can you post the code in a
public repo?

Reply to this email directly or view it on GitHub:
#6 (comment)

@davidbuccola
Copy link
Author

I've created a small reproducing program. You can run it from the IDE or using foreman. You'll need to define a FORCE_DATABASE_URL if you actually want to run the program.

git@github.com:davidbuccola/postloadbug.git

@davidbuccola
Copy link
Author

I'm not sure how this got closed by me. I don't believe I've seen an answer to this yet

@jesperfj
Copy link
Contributor

jesperfj commented Nov 7, 2015

This library is no longer maintained. I recommend using wsc for connecting to Force.com API from Java apps.

@jesperfj jesperfj closed this as completed Nov 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants