Hi people,

given that the following query works as expected:

List results = session.find("from it.cbim.sipp.model.Allevamento a"
        + " where a.indirizzo.comune.provincia.sigla = ?",
          "PG", Hibernate.STRING);

I would expect this other query to work as well:

Criteria criteria = session.createCriteria(Allevamento.class);
criteria.add(Expression.eq("indirizzo.comune.provincia.sigla", "PG"));
List results = criteria.list();

Instead I get the following exception:

net.sf.hibernate.QueryException: could not resolve property: indirizzo.comune.provincia.sigla of: it.cbim.sipp.model.Allevamento
at net.sf.hibernate.persister.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:50)
at net.sf.hibernate.expression.AbstractCriterion.getColumns(AbstractCriterion.java:35)
at net.sf.hibernate.expression.SimpleExpression.toSqlString(SimpleExpression.java:40)
at net.sf.hibernate.loader.CriteriaLoader.<init>(CriteriaLoader.java:64)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3595)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
...


Is this to be considered a bug?

        Ugo


------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to