• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Problem with Hibernate Criteria, Query by Example and "nullable=false"

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

i am using Hibernate Criteria with "Query by Example" and have some problems when i set "nullable=false" for OneToMany mapping inside my entities.
The problem is, that the generated SQL query is not the one i expected.

Here is my example code:

Person.java:


PersonenStichwort.java:


PersonenDao.java:


SQL Query generated by Hibernate:


As you can see, Hibernate inserts "personenst1_.bp_personenid=?" inside the sql-where-clause, cause personenStichworte in Person.java is mapped with "nullable=false". How can i force Hibernate to exclude this property without
changing nullable to true? (I have already tested Example.create(personenStichwort).excludeProperty("bp_personenid"), but doesn't work as well)

Best regards

Peter
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic