está aparecendo o seguinte erro na linha 15
net.sf.hibernate.QueryException: undefined alias: 1 [ select 1 from gmat.persistencia.IndiceCorrecaoDO indCorrecao where indCorrecao.mesano =01/10/2005]
public boolean getDuplicado() throws Exception {
HibernatePersistenceManager pm = HibernateUtil.getPersistenceManager(this);
Session session = pm.getSession();
StringBuffer sql = new StringBuffer();
int anoForm = 0;
int mesForm = 0;
anoForm = this.indiceCorrecaoDO.getMesano().get(Calendar.YEAR);
mesForm = this.indiceCorrecaoDO.getMesano().get(Calendar.MONTH) + 1;
String data = ("01/"+mesForm+"/"+ anoForm);
sql.append(" select 1");
sql.append(" from IndiceCorrecaoDO indCorrecao");
sql.append(" where indCorrecao.mesano = " + data);
Query query = session.createQuery(sql.toString());
if(query.list().size()>0){
return true;
}else{
return false;
}
}
alguém pode ajudar?