I haven't tried Po-Ting Huang's solution in Hibernate 3.2.5 but
unfortunatelly it doesn't work for me in version 4.1.4.

In this version the correct solution is:
setProjection(Projections.sqlProjection("1", new String[]{"value"}, new Type[]{new LongType()}));

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira