• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate - Error using persist() - NullPointerException

 
Rodrigo Sasaki
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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 :
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic