• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

hibernate entity gets null value for nullable integer field  RSS feed

 
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
 
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!