/** * ADVANCED: * Return the receiver's read-object call. * This allows the user to override the read-object operation. */ public Call getReadObjectCall() { if (getReadObjectQuery() == null) { return null; } return getReadObjectQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's read-object call. * This allows the user to override the read-object operation. */ public Call getReadObjectCall() { if (getReadObjectQuery() == null) { return null; } return getReadObjectQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's read-object call. * This allows the user to override the read-object operation. */ public Call getReadObjectCall() { if (getReadObjectQuery() == null) { return null; } return getReadObjectQuery().getDatasourceCall(); }
/** * ADVANCED: * Return 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. * <p> * Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID" */ public String getReadObjectSQLString() { if (getReadObjectQuery() == null) { return null; } return getReadObjectQuery().getSQLString(); }
/** * ADVANCED: * Return 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. * <p> * Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID" */ public String getReadObjectSQLString() { if (getReadObjectQuery() == null) { return null; } return getReadObjectQuery().getSQLString(); }
/** * ADVANCED: * Return 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. * <p> * Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID" */ public String getReadObjectSQLString() { if (getReadObjectQuery() == null) { return null; } return getReadObjectQuery().getSQLString(); }
/** * INTERNAL: * Get custom single object read query from query manager. * Called from {@link #checkForCustomQuery(AbstractSession, AbstractRecord)} to retrieve custom read query. * @return Custom single object read query from query manager. */ @Override protected ObjectLevelReadQuery getReadQuery() { return descriptor.getQueryManager().getReadObjectQuery(); }
/** * INTERNAL: * Convert all the class-name-based settings in this Query Manager to actual class-based * settings * This method is implemented by subclasses as necessary. * @param classLoader */ public void convertClassNamesToClasses(ClassLoader classLoader){ Iterator queryVectors = getQueries().values().iterator(); while (queryVectors.hasNext()){ Iterator queries = ((Vector)queryVectors.next()).iterator();; while (queries.hasNext()){ ((DatabaseQuery)queries.next()).convertClassNamesToClasses(classLoader); } } if (getReadObjectQuery() != null) { getReadObjectQuery().convertClassNamesToClasses(classLoader); } if (getReadAllQuery() != null) { getReadAllQuery().convertClassNamesToClasses(classLoader); } };
/** * INTERNAL: * Convert all the class-name-based settings in this Query Manager to actual class-based * settings * This method is implemented by subclasses as necessary. * @param classLoader */ public void convertClassNamesToClasses(ClassLoader classLoader){ Iterator queryVectors = getQueries().values().iterator(); while (queryVectors.hasNext()){ Iterator queries = ((Vector)queryVectors.next()).iterator();; while (queries.hasNext()){ ((DatabaseQuery)queries.next()).convertClassNamesToClasses(classLoader); } } if (getReadObjectQuery() != null) { getReadObjectQuery().convertClassNamesToClasses(classLoader); } if (getReadAllQuery() != null) { getReadAllQuery().convertClassNamesToClasses(classLoader); } };
/** * INTERNAL: * Convert all the class-name-based settings in this Query Manager to actual class-based * settings * This method is implemented by subclasses as necessary. * @param classLoader */ public void convertClassNamesToClasses(ClassLoader classLoader){ Iterator queryVectors = getQueries().values().iterator(); while (queryVectors.hasNext()){ Iterator queries = ((Vector)queryVectors.next()).iterator();; while (queries.hasNext()){ ((DatabaseQuery)queries.next()).convertClassNamesToClasses(classLoader); } } if (getReadObjectQuery() != null) { getReadObjectQuery().convertClassNamesToClasses(classLoader); } if (getReadAllQuery() != null) { getReadAllQuery().convertClassNamesToClasses(classLoader); } };
/** * INTERNAL: * Select one object of any concrete subclass. */ @Override protected Object selectOneObject(ReadObjectQuery query) throws DescriptorException { // If we came from a source mapping the execute the selection query // we prepared from it. if (selectionQueriesForAllObjects.containsKey(query.getSourceMapping())) { return query.getExecutionSession().executeQuery(selectionQueriesForAllObjects.get(query.getSourceMapping()), query.getTranslationRow()); } else { // Assuming we're doing a find by primary key ... // We have to update the translation row to be to the correct field. AbstractRecord translationRow = (AbstractRecord) query.getTranslationRow().clone(); Vector allFields = new Vector(); for (DatabaseField field : (Vector<DatabaseField>) translationRow.getFields()) { // Remove the table and let the descriptor figure it out. allFields.add(new DatabaseField(field.getName())); } translationRow.getFields().clear(); translationRow.getFields().addAll(allFields); return query.getSession().executeQuery(getDescriptor().getQueryManager().getReadObjectQuery(), translationRow); } } }
manager.setReadAllQuery((ReadAllQuery)getReadAllQuery().clone()); if (getReadObjectQuery() != null) { manager.setReadObjectQuery((ReadObjectQuery)getReadObjectQuery().clone());
getUpdateQuery().setDescriptor(descriptor); if (getReadObjectQuery() != null) { getReadObjectQuery().setReferenceClass(getDescriptor().getJavaClass()); getReadObjectQuery().setDescriptor(descriptor);
getUpdateQuery().setDescriptor(descriptor); if (getReadObjectQuery() != null) { getReadObjectQuery().setReferenceClass(getDescriptor().getJavaClass()); getReadObjectQuery().setDescriptor(descriptor);
getUpdateQuery().setDescriptor(descriptor); if (getReadObjectQuery() != null) { getReadObjectQuery().setReferenceClass(getDescriptor().getJavaClass()); getReadObjectQuery().setDescriptor(descriptor);
queryManager.setReadObjectQuery(readObjectQuery); queryManager.getReadObjectQuery().setName("read" + getJavaClass().getSimpleName());
queryManager.setReadObjectQuery(readObjectQuery); queryManager.getReadObjectQuery().setName("read" + getJavaClass().getSimpleName());
setReadObjectQuery((ReadObjectQuery)parentQueryManager.getReadObjectQuery().clone());
setReadObjectQuery((ReadObjectQuery)parentQueryManager.getReadObjectQuery().clone());
setReadObjectQuery((ReadObjectQuery)parentQueryManager.getReadObjectQuery().clone());