Code example for Session

Methods: createQuery

0
     * Creates a query based on the select statement initlaized in the query provider 
     * construction. 
     */ 
    public Query createQuery(Session session, EntityInformation entityInformation) {
        if (selectQuery != null) {
            return session.createQuery(selectQuery);
        } 
        return session.createQuery("from " + entityInformation.getName());
    } 
 
    /** 
     * Creates the Hibernate criteria for the given entity information. Returns 
     * <code>null</code> if the select query is set. 
     */ 
    public Criteria createCriteria(Session session, EntityInformation entityInformation) {
        if (!isUsingDefaultSelectQuery) {
            return null; 
        } 
    	return session.createCriteria(entityInformation.getName());
    }