When i use alias for column i get error. Without alias everytinig works good. What is the problem with that ? This is simple example, but need to use more aliases in real pr
If your "product" is mapped, hibernate probably don't know about "myId" and therefore can't select it. You can try something like:
getSession().createSQLQuery(sql).addScalar("myId", Hibernate.LONG)