/** * ADVANCED: * Set the receiver's read SQL string. * This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. * The arguments are translated from the fields of the read arguments row, * through replacing the field names marked by '#' with the values for those fields. * This must accept only the primary key of the object as arguments. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * <p> * Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID" */ public void setReadObjectSQLString(String sqlString) { if (sqlString == null) { return; } ReadObjectQuery query = new ReadObjectQuery(); query.setSQLString(sqlString); setReadObjectQuery(query); }
/** * ADVANCED: * Set the receiver's read SQL string. * This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. * The arguments are translated from the fields of the read arguments row, * through replacing the field names marked by '#' with the values for those fields. * This must accept only the primary key of the object as arguments. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * <p> * Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID" */ public void setReadObjectSQLString(String sqlString) { if (sqlString == null) { return; } ReadObjectQuery query = new ReadObjectQuery(); query.setSQLString(sqlString); setReadObjectQuery(query); }
/** * ADVANCED: * Set the receiver's read SQL string. * This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. * The arguments are translated from the fields of the read arguments row, * through replacing the field names marked by '#' with the values for those fields. * This must accept only the primary key of the object as arguments. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * <p> * Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID" */ public void setReadObjectSQLString(String sqlString) { if (sqlString == null) { return; } ReadObjectQuery query = new ReadObjectQuery(); query.setSQLString(sqlString); setReadObjectQuery(query); }
/** * PUBLIC: * Read the first instance 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 ReadObjectQuery. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * * @see ReadObjectQuery */ public Object readObject(Class domainClass, String sqlString) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setReferenceClass(domainClass); query.setSQLString(sqlString); query.setIsExecutionClone(true); return executeQuery(query); }
/** * PUBLIC: * Read the first instance 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 ReadObjectQuery. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * * @see ReadObjectQuery */ public Object readObject(Class domainClass, String sqlString) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setReferenceClass(domainClass); query.setSQLString(sqlString); query.setIsExecutionClone(true); return executeQuery(query); }
/** * PUBLIC: * Read the first instance 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 ReadObjectQuery. * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. * * @see ReadObjectQuery */ public Object readObject(Class domainClass, String sqlString) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setReferenceClass(domainClass); query.setSQLString(sqlString); query.setIsExecutionClone(true); return executeQuery(query); }