[Hibernate] AssertionFailure null id in entry

S

Stefanie Ertheld

The code for the LIKE selection:
>return myHibernateSession.createCriteria(MYOBJECT.class)
>.add(Expression.like(MYOBJECT.MYPROPERTYNAME,
myCompareValue)).list();

I don't have the real thing at hand so I can't test it and so I neither
have the exact error at hand - but doing some research and more
thinking, I guess it was a PropertyNotFoundException.

Seems like Hibernate couldn't find MYOBJECT.MYPROPERTYNAME. What are the
exact rules for the annotations? Do they have to be above the setter
methods, above the getter methods, above both, or above the private
instance variables. I put them abouve the private instance variables,
because I think that makes it the easiest to read - and this worked for
my insert statement - are there differences for the Like statement???
I also just read for the getter and setter methods, only the very first
letter may and must be a capital letter - so it must be
setHousenumber and getHousenumber NOT setHouseNumber and getHouseNumber.
True? Pretty stupid imho. Maybe that was the reason??

Thanks in advance,

Stefanie
 
Joined
Mar 15, 2008
Messages
2
Reaction score
0
I actually had exactly the same problem - solved by describing all constraints in @Table annotation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top