baliukas wrote:
Have you tried to execute "select {cov.covno} ..." ?
Yes. That didn't work either.
String qryString = "select {cov.covno}, {cov.covdesc}, {polcov.limitsno} from Coveragelku {cov}, Policycoverage {polcov}";
Query qry = session.createSQLQuery(qryString).addEntity("cov", Coverage.class).addEntity("polcov", Policycoverage.class);
List list = qry.list();
above code gives below error...
DEBUG - select covno0_, covdesc3_0_, limitsno2_1_ from Coveragelku cov, Policycoverage polcov
Hibernate: select covno0_, covdesc3_0_, limitsno2_1_ from Coveragelku cov, Policycoverage polcov
DEBUG - preparing statement
DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG - closing statement
DEBUG - could not execute query [
select covno0_, covdesc3_0_, limitsno2_1_ from Coveragelku cov, Policycoverage polcov]
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid column name 'covno0_'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)