This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

java.lang.NullPointerException at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having an object called Customer, It will have a relationship with address object (one-to-one relation) and Tickets object (one-to-many relation). [Each customer can have many tickets]. And Each ticket will have a payment object (One-to-one relation). I specified the relation in hibernate annotation.

I am getting the below error when executing the test,



My Application code is

My objects, Customer :



Address :



Tickets :



Payment :




Hibernate Configuration is :




Where am i wrong in this code ?
Screen-Shot-2013-05-22-at-9.23.01-AM.png
[Thumbnail for Screen-Shot-2013-05-22-at-9.23.01-AM.png]
Relationship Diagram
 
kaleeswaran Gounder
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the answer, The mistake is on the below line of Payment POJO.

@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "tickets"))

Here I specified like value = "tickets" which is invalid in this mapping. I have to specify like value = "ticket". This fixed it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!