I used createCriteria()
and setFetchMode()
methods to join and select. I don't need all columns so I want to select specific columns to improve performance, but I can't find how to do it. Maybe should I use HQL instead?
You will need to set Projection on specific properties.
Example:
criteria.setProjection( Projections.projectionList()
.add( Projections.property("cat.name"), "catName" )
.add( Projections.property("kit.name"), "kitName" )
);