I have an sql query as follows:
List employees = getCurrentSession()
.createSQLQuery(
\"select\"
You can use addScalar(String columnAlias, Type type) to explicitly declare the column alias of your native SQL:
getCurrentSession()
.createSQLQuery( "select e.id as id,e.first_name as firstName,e.password as password from xxxxxx")
.addScalar("id",StandardBasicTypes.INTEGER )
.addScalar("firstName",StandardBasicTypes.STRING )
.addScalar("password",StandardBasicTypes.STRING )
.setResultTransformer(Transformers.aliasToBean(Employee.class))
.list();