Regular |
|
Joined: Sat May 15, 2004 4:27 am Posts: 79
|
Hi,
i am trying to perform that query and i have exception :
Query q = session.getSession().createQuery("" +
"SELECT M2.machineId " +
"FROM ( " +
" SELECT * " +
" FROM fr.test.Machine Ma " +
") M2 "
);
Hibernate (2.1.6) throws me that exception :
net.sf.hibernate.QueryException: in expected: SELECT [SELECT M2.machineId FROM ( SELECT * FROM fr.test.Machine Ma ) M2 ]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:294)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1562)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1533)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at fr.gouv.finances.copernic.mas.stf.test.hibernate.TestSQL.main(TestSQL.java:22)
|
|