Projection « Fetch « JPA Q&A





1. Not able to fetch property using Criteria and Projection    stackoverflow.com

      <id name="id" type="java.lang.Long">
            <column name="MBR_ATR_ID"/>
          ...

2. Criteria, Projections, and lazy-fetch collections.    forum.hibernate.org

All, Hibernate 3.0.5.... trying to project a lazy-fetched collection via a Criteria query: Code: List authors = session.createCriteria(Content.class) .setProjection(Projections.property("authors")) .list(); System.out.println("authors: " + authors); Authors is a lazy-fetched List... and when I execute this, I get a list of nulls: authors: [null, null, null, null, null, null, null, ...

3. How to retrieve projection and object using Criteria Query    forum.hibernate.org

Hibernate version:3.30GA I need to do something similar to the following HQL, but need to use the Criteria API because I'm doing complex query assembly on the fly: "select p , p.field1 * p.field2 / p.field3 as calc1 from Person p order by calc1 desc " I'm having trouble using the criteria API. For example when I do the following: Code: ...