• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Hibernate - Error using persist() - NullPointerException

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone, I'm trying to persist an object with many dependencies with it, and with different types of relationship, @OneToMany, @ManyToOne, etc. It's a big DTO.

But I get this exception on persisting.



A NullPointerException é lançada dentro do método do Hibernate, alguém ja se deparou com esse problema e/ou sabe como resolver?
As you can see the Exception is thrown inside Hibernate's method, has anyone seen this problem before and/or know how to solve it?

On the DAO I use persist() on my DTO using my EntityManager, just like I do everywhere else in the system, so it wouldn't be a configuration problem, I believe.
I have tried using getReference() and find() on the dependencies before persisting, but still got the same Exception.

Any ideas? Thank you all in advance!

Please let me know if there is any additional information you may need.
 
Rodrigo Sasaki
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of my attributes had a Composite Id that wasn't propperly set, after fixing that, I could persist with no problems.

Thanks anyway :
reply
    Bookmark Topic Watch Topic
  • New Topic