Java 类org.hibernate.transform.AliasToBeanConstructorResultTransformer 实例源码

项目:lams    文件:ConstructorNode.java   
@Override
public ResultTransformer getResultTransformer() {
    if ( constructor != null ) {
        return new AliasToBeanConstructorResultTransformer( constructor );
    }
    else if ( isMap ) {
        return Transformers.ALIAS_TO_ENTITY_MAP;
    }
    else if ( isList ) {
        return Transformers.TO_LIST;
    }
    throw new QueryException( "Unable to determine proper dynamic-instantiation tranformer to use." );
}
项目:lams    文件:HolderInstantiator.java   
public static ResultTransformer createSelectNewTransformer(Constructor constructor, boolean returnMaps, boolean returnLists) {
    if ( constructor != null ) {
        return new AliasToBeanConstructorResultTransformer(constructor);
    }
    else if ( returnMaps ) {
        return Transformers.ALIAS_TO_ENTITY_MAP;            
    }
    else if ( returnLists ) {
        return Transformers.TO_LIST;
    }       
    else {
        return null;
    }
}
项目:cacheonix-core    文件:HolderInstantiator.java   
public static ResultTransformer createSelectNewTransformer(Constructor constructor, boolean returnMaps, boolean returnLists) {
    if ( constructor != null ) {
        return new AliasToBeanConstructorResultTransformer(constructor);
    }
    else if ( returnMaps ) {
        return Transformers.ALIAS_TO_ENTITY_MAP;            
    }
    else if ( returnLists ) {
        return Transformers.TO_LIST;
    }       
    else {
        return null;
    }
}
项目:cacheonix-core    文件:HolderInstantiator.java   
static public HolderInstantiator createClassicHolderInstantiator(Constructor constructor, 
        ResultTransformer transformer) {
    if ( constructor != null ) {
        return new HolderInstantiator(new AliasToBeanConstructorResultTransformer(constructor), null);
    }
    else {
        return new HolderInstantiator(transformer, null);
    }
}
项目:lams    文件:HolderInstantiator.java   
static public ResultTransformer resolveClassicResultTransformer(
        Constructor constructor,
        ResultTransformer transformer) {
    return constructor != null ? new AliasToBeanConstructorResultTransformer( constructor ) : transformer;
}
项目:finances    文件:TransactionCategoryDaoImpl.java   
@SuppressWarnings("unchecked")
public List<TransactionCategorySummary> getTransactionCategorySummaries() {
    return getSession().getNamedQuery(TransactionCategory.SUMMARY_QUERY)
        .setResultTransformer(new AliasToBeanConstructorResultTransformer(getSummaryConstructor()))
        .list();
}
项目:finances    文件:PayeeDaoImpl.java   
@SuppressWarnings("unchecked")
public List<PayeeSummary> getPayeeSummaries() {
    return getSession().getNamedQuery(Payee.SUMMARY_QUERY)
        .setResultTransformer(new AliasToBeanConstructorResultTransformer(getPayeeSummaryConstructor()))
        .list();
}
项目:finances    文件:TransactionGroupDaoImpl.java   
@SuppressWarnings("unchecked")
public List<TransactionGroupSummary> getTransactionGroupSummaries() {
    return getSession().getNamedQuery(TransactionGroup.SUMMARY_QUERY)
        .setResultTransformer(new AliasToBeanConstructorResultTransformer(getSummaryConstructor()))
        .list();
}
项目:finances    文件:AccountDaoImpl.java   
@SuppressWarnings("unchecked")
public List<AccountSummary> getAccountSummaries() {
    return getSession().getNamedQuery(Account.SUMMARY_QUERY)
        .setResultTransformer(new AliasToBeanConstructorResultTransformer(getAccountSummaryConstructor()))
        .list();
}