I have a table with 11 columns, but I need to get only 2 of them in my application, I\'m using spring/hibernate/DAO combination. For now I have a domain class which includes
Try:
SELECT myEntity.one, myEntity.two FROM MyEntity myEntity
You can even do :
SELECT new MyEntityDescription(myEntity.one, myEntity.two) FROM MyEntity myEntity
to get a list of entity descriptions.