• Post Reply Bookmark Topic Watch Topic
  • New Topic

hibernate entity gets null value for nullable integer field

 
nisha dathri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Below given is my hibernate entity.



I have a nullable Number field "DOC_FROM_NUMBER" in Oracle table DOCUMENT_P.

List<DocumentEntity > List = getEntityManager().createQuery("from PrefixEntity", DocumentEntity .class).getResultList();

Now, when running the above statement, the problem is i am getting only null values in the docFromNumber and docToNumber fields, it is a nullable field in the database.when i checked the table, these columns having values for some of the records.

Can any one suggest me some solutions...

thanks,
Nisha
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose you want to hit document entity table, but your query says "from PrefixEntity". Are you sure it is correct?
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!