Why is it when I use:
Code:
Long oid = new Long(42);
if ((temp = HibSes.curSes().createCriteria(foo.class).add(Expression.eq("id",oid)).list()).size() == 1)
I get a ClassCastException, and
Code:
if ((temp = HibSes.curSes().find("from foo bar where bar.id = ? ", oid, Hibernate.LONG)).size() == 1)
works fine,
I love the criteria API (still some non declarative things in there)
and want to use it everywhere I can.
All I want is to load an Object with an OID,
(I don't know if oid represents a valid objectid)
(I've read somewhere that using load() for this purpose and catching the exception is not elegant)
Bz