This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PersistenceService

 
Florian Marquardt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI!

I have a problem!


I have got the Exception


if i tried to make this:



and when i try to do this:



i get the value null back!

What did i wrong?
Has anyone experiences with PersistenceService?

thanks a lot
 
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I can tell you at least what I did.

First, I set the PersistenceService as an instance variable (but that's more because I needed to use it in multiple places. Then, in my constructor for the object in question, I did:



Then, each time when I tried to use the PersistenceService, I simply tested against null first to ensure that it was initialized. It seems to work fine.

Hope that helps!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic