@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." ); }
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; } }
static public HolderInstantiator createClassicHolderInstantiator(Constructor constructor, ResultTransformer transformer) { if ( constructor != null ) { return new HolderInstantiator(new AliasToBeanConstructorResultTransformer(constructor), null); } else { return new HolderInstantiator(transformer, null); } }
static public ResultTransformer resolveClassicResultTransformer( Constructor constructor, ResultTransformer transformer) { return constructor != null ? new AliasToBeanConstructorResultTransformer( constructor ) : transformer; }
@SuppressWarnings("unchecked") public List<TransactionCategorySummary> getTransactionCategorySummaries() { return getSession().getNamedQuery(TransactionCategory.SUMMARY_QUERY) .setResultTransformer(new AliasToBeanConstructorResultTransformer(getSummaryConstructor())) .list(); }
@SuppressWarnings("unchecked") public List<PayeeSummary> getPayeeSummaries() { return getSession().getNamedQuery(Payee.SUMMARY_QUERY) .setResultTransformer(new AliasToBeanConstructorResultTransformer(getPayeeSummaryConstructor())) .list(); }
@SuppressWarnings("unchecked") public List<TransactionGroupSummary> getTransactionGroupSummaries() { return getSession().getNamedQuery(TransactionGroup.SUMMARY_QUERY) .setResultTransformer(new AliasToBeanConstructorResultTransformer(getSummaryConstructor())) .list(); }
@SuppressWarnings("unchecked") public List<AccountSummary> getAccountSummaries() { return getSession().getNamedQuery(Account.SUMMARY_QUERY) .setResultTransformer(new AliasToBeanConstructorResultTransformer(getAccountSummaryConstructor())) .list(); }