-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: help me with Projection
PostPosted: Fri Aug 07, 2009 1:37 pm 
Newbie

Joined: Fri Aug 07, 2009 1:18 pm
Posts: 2
Hi all, i'm developing the following query:

Code:
criteria.add(Expression.ge("idradiologo", Long.valueOf(idradiologo)));
criteria.setProjection( Projections.projectionList()
  .add( Projections.rowCount(), "cantidad" )
  .add( Projections.groupProperty("fechaexamen"), "fechaexamen" )
  .add( Projections.groupProperty("idradiologo"), "idradiologo" )
);
criteria.add(Expression.between("fechaasignacion",
  this.fechainicio,this.fechatermino));
      
criteria.addOrder(Order.asc("fechaexamen"));

criteria.setResultTransformer(Transformers.aliasToBean
  (ExamenPorRadiologo.class));

criteria.add(Expression.ge("idradiologo", Long.valueOf(idradiologo))) with this line of code tries to select all idradiologo different from Long.valueOf(idradiologo), but display the following error:

Code:
10:49:04,123 WARN  [JDBCExceptionReporter] SQL Error: 1054, SQLState: 42S22
10:49:04,123 ERROR [JDBCExceptionReporter] Unknown column 'y2_' in 'where
clause'
...
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:
Unknown column 'y2_' in 'where clause'
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)



How can I fix it?
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.