• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate: "not-null property references a null or transient value" only with HSQL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I have an already release software that makes use of Hibernate+Postgre, and now I have to make it compatible ALSO with HSQL.

All in all, I managed to get everything working, except the following issue. I have a Product and a ProductDetail entities. And the latter has a reference to the former and everything works like a charm on Postgre. When I create a product (and proddetails) the Hibernate can save them. But when I use the HSQL, it flops:

not-null property references a null or transient value: xx.xxx.xxxx.product.ProductDetail.product

But the thing is, I've inspected the entity on the line:

HibernateUtil.getSession().saveOrUpdate(entity);

And it is a ProductDetail, and its product field IS NOT EMPTY. It contains a valid Product object. And that is no surprise, as I've already written it works with Postgre.

Any clues?

 
Ranch Hand
Posts: 177
Hibernate Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think we need your mapping for the entities related to your problem.
Maybe you are trying to save an unsaved entity and you forgot a cascade.
 
Alvaro Victor Cavalcanti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that's the problem, since it works with Postgres. But here it goes (some parts were ommited due to confidentiality):

ProductDetail.hbm.xml


Product.hbm.xml
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic