|
|
|
|
|
|
i have a simple query using Hibernate 3.2.6 with ilike as well using projections but i am getting the following error.
{noformat} com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'y1_' in 'where clause' {noformat} here is my code id,c07 and c08 are valid columns names in schema.
{code} public ArrayList<Student>getListForStudentsByRef(String ref)//list of Students not full only few columns...... { HibernateHandler handler = new HibernateHandler(true); Session session = handler.getSession().getSessionFactory().openSession(); ProjectionList p = Projections.projectionList().add(Projections.property("id"), "id") .add(Projections.property("c07"),"c07") .add(Projections.property("c08"),"c08"); Criteria c = session.createCriteria(Student.class).setProjection(p).setResultTransformer(Transformers.aliasToBean(Student.class)); c.add(Restrictions.ilike("c07",ref,MatchMode.START));//Error java.util.ArrayList<Student> list=new java.util.ArrayList<Student>(c.list()); session.flush();session.close(); return list; } {code} i am getting this sentence
{noformat} select this_.ID as y0_,this_.C07 as y1_,this_.C08 as y2_ from student this_ where lower(y1_) like ? {noformat} this is working good in 4.1.6 is working OK without using projections what i am doing wrong is this a bug.
|
|
|
|
|
|