I have an <<Entity>> class, Document, with this operation:

 

findEntitiesByDefinitions( definitions : List ) : List

Visibility: public

Query: true

Scope: classifier

 

This generates this code:

 

    public java.util.List findEntitiesByDefinitions(final int transform, final java.lang.String queryString, final java.util.List definitions)

    {

        try

        {

            net.sf.hibernate.Query queryObject = super.getSession(false).createQuery(queryString);

            queryObject.setParameterList(0, definitions);

 

            java.util.List results = queryObject.list();

            transformEntities(transform, results);

            return results;

        }

        catch (net.sf.hibernate.HibernateException ex)

        {

            throw super.convertHibernateAccessException(ex);

        }

    }

 

The method net.sf.hibernate.Query.setParameterList(int, List) doesn’t exist, so the javac compiler says “cannot resolve symbol”.

 

There is a setParameterList(String name, Collection vals).  The code author was probably hoping for a call similar to setParameter(int position, Object val), but unfortunately a List version of this (i.e. that takes a position int) isn’t provided by Hibernate.  Apparently one must specify the parameter name, not the position.

 

 

Greg

 

Reply via email to