This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate AssertionFailure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate AssertionFailure" Watch "Hibernate AssertionFailure" New topic

Hibernate AssertionFailure

ruben depuben

Joined: Feb 19, 2009
Posts: 6

I am running into the following Hibernate exception when trying to get Sections with a certain name from Hibernate.

org.hibernate.AssertionFailure: null id in model.Section entry (don't flush the Session after an exception occurs)

at dao.hibernate.SectionDAOHibernate.isUniqueNameInsert(

Line 76 is the line where I try to get the Sections with q.list().

Any clue as to what may be wrong here? Can this be caused by an empty id in the database or something? I generate the indexes with the code below and this works fine for my other entities...

@Id @GeneratedValue
public Long getId() {
return id;

Best, Ruben

It is sorta covered in the JavaRanch Style Guide.
subject: Hibernate AssertionFailure
Similar Threads
how can i join two different table
How to query a value typed object
inner join not working !!! please help
size() collection not working in HQL
wpsUrlGeneration in websphere portal 6