/** * PUBLIC: * Read all of the instances of the class from the database. * This operation can be customized through using a ReadAllQuery, * or through also passing in a selection criteria. * * @see ReadAllQuery * @see #readAllObjects(Class, Expression) */ public Vector readAllObjects(Class domainClass) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setIsExecutionClone(true); query.setReferenceClass(domainClass); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all of the instances of the class from the database. * This operation can be customized through using a ReadAllQuery, * or through also passing in a selection criteria. * * @see ReadAllQuery * @see #readAllObjects(Class, Expression) */ @Override public Vector readAllObjects(Class domainClass) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setIsExecutionClone(true); query.setReferenceClass(domainClass); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all of the instances of the class from the database. * This operation can be customized through using a ReadAllQuery, * or through also passing in a selection criteria. * * @see ReadAllQuery * @see #readAllObjects(Class, Expression) */ public Vector readAllObjects(Class domainClass) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setIsExecutionClone(true); query.setReferenceClass(domainClass); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all of the instances of the class from the database matching the given expression. * This operation can be customized through using a ReadAllQuery. * * @see ReadAllQuery */ public Vector readAllObjects(Class domainClass, Expression expression) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(domainClass); query.setSelectionCriteria(expression); query.setIsExecutionClone(true); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all of the instances of the class from the database matching the given expression. * This operation can be customized through using a ReadAllQuery. * * @see ReadAllQuery */ public Vector readAllObjects(Class domainClass, Expression expression) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(domainClass); query.setSelectionCriteria(expression); query.setIsExecutionClone(true); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all the instances of the class from the database returned through execution the Call string. * The Call can be an SQLCall or JPQLCall. * * example: session.readAllObjects(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE")); * @see Call */ public Vector readAllObjects(Class referenceClass, Call aCall) throws DatabaseException { ReadAllQuery raq = new ReadAllQuery(); raq.setReferenceClass(referenceClass); raq.setCall(aCall); raq.setIsExecutionClone(true); return (Vector)executeQuery(raq); }
/** * PUBLIC: * Read all the instances of the class from the database returned through execution the Call string. * The Call can be an SQLCall or JPQLCall. * * example: session.readAllObjects(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE")); * @see Call */ public Vector readAllObjects(Class referenceClass, Call aCall) throws DatabaseException { ReadAllQuery raq = new ReadAllQuery(); raq.setReferenceClass(referenceClass); raq.setCall(aCall); raq.setIsExecutionClone(true); return (Vector)executeQuery(raq); }
/** * PUBLIC: * Read all of the instances of the class from the database matching the given expression. * This operation can be customized through using a ReadAllQuery. * * @see ReadAllQuery */ @Override public Vector readAllObjects(Class domainClass, Expression expression) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(domainClass); query.setSelectionCriteria(expression); query.setIsExecutionClone(true); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all the instances of the class from the database returned through execution the Call string. * The Call can be an SQLCall or JPQLCall. * * example: session.readAllObjects(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE")); * @see Call */ @Override public Vector readAllObjects(Class referenceClass, Call aCall) throws DatabaseException { ReadAllQuery raq = new ReadAllQuery(); raq.setReferenceClass(referenceClass); raq.setCall(aCall); raq.setIsExecutionClone(true); return (Vector)executeQuery(raq); }
/** * PUBLIC: * Read all of the instances of the class from the database return through execution the SQL string. * The SQL string must be a valid SQL select statement or selecting stored procedure call. * This operation can be customized through using a ReadAllQuery. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * * @see ReadAllQuery */ public Vector readAllObjects(Class domainClass, String sqlString) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(domainClass); query.setSQLString(sqlString); query.setIsExecutionClone(true); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all of the instances of the class from the database return through execution the SQL string. * The SQL string must be a valid SQL select statement or selecting stored procedure call. * This operation can be customized through using a ReadAllQuery. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * * @see ReadAllQuery */ public Vector readAllObjects(Class domainClass, String sqlString) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(domainClass); query.setSQLString(sqlString); query.setIsExecutionClone(true); return (Vector)executeQuery(query); }
/** * PUBLIC: * Read all of the instances of the class from the database return through execution the SQL string. * The SQL string must be a valid SQL select statement or selecting stored procedure call. * This operation can be customized through using a ReadAllQuery. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * * @see ReadAllQuery */ public Vector readAllObjects(Class domainClass, String sqlString) throws DatabaseException { ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(domainClass); query.setSQLString(sqlString); query.setIsExecutionClone(true); return (Vector)executeQuery(query); }
query.setIsExecutionClone(true); query.addArgument(ForeignReferenceMapping.QUERY_BATCH_PARAMETER); query.addArgumentValue(foreignKeyValues);
query.setIsExecutionClone(true); query.addArgument(ForeignReferenceMapping.QUERY_BATCH_PARAMETER); query.setSession(session);
query.setIsExecutionClone(true); query.addArgument(ForeignReferenceMapping.QUERY_BATCH_PARAMETER); query.addArgumentValue(foreignKeyValues);
query.setIsExecutionClone(true); query.addArgument(ForeignReferenceMapping.QUERY_BATCH_PARAMETER); query.setSession(session);
query.setIsExecutionClone(true); query.setSession(session); query.addArgument(ForeignReferenceMapping.QUERY_BATCH_PARAMETER);
query.setIsExecutionClone(true); query.addArgument(ForeignReferenceMapping.QUERY_BATCH_PARAMETER); query.setSession(session);
/** * INTERNAL: * Check to see if a custom query should be used for this query. * This is done before the query is copied and prepared/executed. * null means there is none. */ @Override protected DatabaseQuery checkForCustomQuery(AbstractSession session, AbstractRecord translationRow) { Boolean useCustomQuery = isCustomQueryUsed; checkDescriptor(session); // Check if user defined a custom query. if (useCustomQuery == null) { setIsCustomQueryUsed((!isUserDefined()) && isExpressionQuery() && (getSelectionCriteria() == null) && isDefaultPropertiesQuery() && (!hasOrderByExpressions()) && (this.descriptor.getQueryManager().hasReadAllQuery())); // Value of isCustomQueryUsed is updated by setIsCustomQueryUsed method. useCustomQuery = isCustomQueryUsed; } if (useCustomQuery != null && useCustomQuery.booleanValue()) { ReadAllQuery customQuery = this.descriptor.getQueryManager().getReadAllQuery(); if (this.accessors != null) { customQuery = (ReadAllQuery) customQuery.clone(); customQuery.setIsExecutionClone(true); customQuery.setAccessors(this.accessors); } isCustomQueryUsed = useCustomQuery; return customQuery; } isCustomQueryUsed = useCustomQuery; return null; }
/** * INTERNAL: * Select all objects for a concrete descriptor. */ protected Object selectAllObjects(ReadAllQuery query) { ReadAllQuery concreteQuery = (ReadAllQuery) query.deepClone(); concreteQuery.setReferenceClass(descriptor.getJavaClass()); concreteQuery.setDescriptor(descriptor); // Avoid cloning the query again ... concreteQuery.setIsExecutionClone(true); concreteQuery.getExpressionBuilder().setQueryClassAndDescriptor(descriptor.getJavaClass(), descriptor); // Update the selection criteria if needed as well and don't lose // the translation row. if (concreteQuery.getQueryMechanism().getSelectionCriteria() != null) { //make sure query builder is used for the selection criteria as deepClone will create //two separate builders. concreteQuery.setSelectionCriteria(concreteQuery.getQueryMechanism().getSelectionCriteria().rebuildOn(concreteQuery.getExpressionBuilder())); return query.getSession().executeQuery(concreteQuery, query.getTranslationRow()); } return query.getSession().executeQuery(concreteQuery); }