/** * INTERNAL: * Select one object of any concrete subclass. */ protected Object selectOneObject(ReadObjectQuery query) throws DescriptorException { ReadObjectQuery concreteQuery = (ReadObjectQuery)prepareQuery(query); return query.getSession().executeQuery(concreteQuery, concreteQuery.getTranslationRow()); }
/** * INTERNAL: * Select one object of any concrete subclass. */ protected Object selectOneObject(ReadObjectQuery query) throws DescriptorException { ReadObjectQuery concreteQuery = (ReadObjectQuery)prepareQuery(query); return query.getSession().executeQuery(concreteQuery, concreteQuery.getTranslationRow()); }
/** * 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); } } }
/** * INTERNAL: * Select one object of any concrete subclass. */ protected Object selectOneObject(ReadObjectQuery query) throws DescriptorException { ReadObjectQuery concreteQuery = (ReadObjectQuery) query.clone(); Class javaClass = descriptor.getJavaClass(); concreteQuery.setReferenceClass(javaClass); concreteQuery.setDescriptor(descriptor); return query.getSession().executeQuery(concreteQuery, concreteQuery.getTranslationRow()); }
DatabaseCall call = (DatabaseCall)getCall().clone(); call.setQuery(this); AbstractRecord translationRow = getTranslationRow(); call.translate(getTranslationRow(), null, unitOfWork); PreparedStatement statement = null; ResultSet resultSet = null;
protected Object remoteExecute() { // Do a cache lookup. checkDescriptor(session); // As the selection object is transient, compute the key. if (getSelectionObject() != null) { // Must be checked separately as the expression and row is not yet set. setSelectionKey(getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(getSelectionObject(), session)); } Object cacheHit = checkEarlyReturn(getSession(), getTranslationRow()); if ((cacheHit != null) || shouldCheckCacheOnly()) { return cacheHit; } return super.remoteExecute(); }
protected Object remoteExecute() { // Do a cache lookup. checkDescriptor(session); // As the selection object is transient, compute the key. if (getSelectionObject() != null) { // Must be checked separately as the expression and row is not yet set. setSelectionId(getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(getSelectionObject(), session)); } Object cacheHit = checkEarlyReturn(getSession(), getTranslationRow()); if ((cacheHit != null) || shouldCheckCacheOnly()) { if (cacheHit == InvalidObject.instance) { return null; } return cacheHit; } return super.remoteExecute(); }
protected Object remoteExecute() { // Do a cache lookup. checkDescriptor(session); // As the selection object is transient, compute the key. if (getSelectionObject() != null) { // Must be checked separately as the expression and row is not yet set. setSelectionId(getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(getSelectionObject(), session)); } Object cacheHit = checkEarlyReturn(getSession(), getTranslationRow()); if ((cacheHit != null) || shouldCheckCacheOnly()) { if (cacheHit == InvalidObject.instance) { return null; } return cacheHit; } return super.remoteExecute(); }
result = registerResultInUnitOfWork(row, (UnitOfWorkImpl)session, getTranslationRow(), true); } else { if (row != null) {
AbstractRecord row = null; Object sopObject = getTranslationRow().getSopObject(); boolean useOptimization = false; if (sopObject == null) {
AbstractRecord row = null; Object sopObject = getTranslationRow().getSopObject(); boolean useOptimization = false; if (sopObject == null) {