I\'ve got an simple Hibernate entity for which I use the @Formula annotion:
@Id
private Long id;
private String name;
@Formula(\"(select count(f.*) fro
Indeed, this seems to be the problem reported in HHH-2225 (that HHH-2536 duplicates). Unfortunately, the issue is not fixed and I'm afraid you'll have to either use HQL or submit a patch (you can start with voting on the issue but I wouldn't expect a fast resolution given that this issue is almost four years old).
Simply way , don't use createNativeQuery , just use createQuery .. or make a transiant with getter convat
We could use currentSession.createQuery() instead of currentSession.createSQLQuery(). The query will be slightly different.
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/queryhql.html#queryhql-subqueries