afsar khan wrote:Dear Ranch Hand,
If you use Criteria Than also you do not need to get the whole object if you are creating a Criterai Query and by using Projection Class you can get the required properties also.
Here is a simple way to get the results as List of object array containing the name property.
List results = session.createCriteria(A.class)
.setProjection( Projections.projectionList()
.add( Projections.property("name"), "Name" )
)
.add( Restrictions.eq("Name", "Your_Condition") )
Hope this will help you...
Didn't know about the Projection class. I'll have to take a look.