Code example for Session

Methods: createCriteria

0
     *            the hibernate session used to create the criteria. 
     * @return the base criteria object. 
     */ 
    public Criteria getCriteria(final Session hibernateSession)
    { 
        Criteria criteria = hibernateSession.createCriteria(Person.class);
        ProjectionList fields = Projections.projectionList();
        fields.add(getColumn("id"));
        fields.add(getColumn("dateAdded"));
        fields.add(getColumn("accountId"));
        fields.add(getColumn("openSocialId"));
        fields.add(getColumn("avatarId"));
        fields.add(getColumn("avatarCropX"));
        fields.add(getColumn("avatarCropY"));
        fields.add(getColumn("avatarCropSize"));
        fields.add(getColumn("lastName"));
        fields.add(getColumn("displayNameSuffix"));
        fields.add(getColumn("displayName"));
        fields.add(getColumn("preferredName"));
        fields.add(getColumn("jobDescription"));