public EISOneToOneMapping() { this.selectionQuery = new ReadObjectQuery(); this.foreignKeyFields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(1); this.sourceToTargetKeyFields = new HashMap(2); this.targetToSourceKeyFields = new HashMap(2); }
public EISOneToOneMapping() { this.selectionQuery = new ReadObjectQuery(); this.foreignKeyFields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(1); this.sourceToTargetKeyFields = new HashMap(2); this.targetToSourceKeyFields = new HashMap(2); }
public EISOneToOneMapping() { this.selectionQuery = new ReadObjectQuery(); this.foreignKeyFields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(1); this.sourceToTargetKeyFields = new HashMap(2); this.targetToSourceKeyFields = new HashMap(2); }
/** * PUBLIC: * Default constructor. */ public VariableOneToOneMapping() { this.selectionQuery = new ReadObjectQuery(); this.sourceToTargetQueryKeyNames = new HashMap(2); this.typeIndicatorTranslation = new HashMap(5); this.typeIndicatorNameTranslation = new HashMap(5); this.foreignKeyFields = NonSynchronizedVector.newInstance(1); //right now only ForeignKeyRelationships are supported this.isForeignKeyRelationship = false; }
/** * PUBLIC: * Default constructor. */ public VariableOneToOneMapping() { this.selectionQuery = new ReadObjectQuery(); this.sourceToTargetQueryKeyNames = new HashMap(2); this.typeIndicatorTranslation = new HashMap(5); this.typeIndicatorNameTranslation = new HashMap(5); this.foreignKeyFields = NonSynchronizedVector.newInstance(1); //right now only ForeignKeyRelationships are supported this.isForeignKeyRelationship = false; }
/** * Helper method to simplify creating a native ReadObjectQuery using the * entity type name (descriptor alias) */ public ReadObjectQuery newReadObjectQuery(String typeName) { DynamicType type = getType(typeName); if (type == null) { throw new IllegalArgumentException("DynamicHelper.createQuery: Dynamic type not found: " + typeName); } return new ReadObjectQuery(type.getJavaClass()); }
/** * Helper method to simplify creating a native ReadObjectQuery using the * entity type name (descriptor alias) */ public ReadObjectQuery newReadObjectQuery(String typeName) { DynamicType type = getType(typeName); if (type == null) { throw new IllegalArgumentException("DynamicHelper.createQuery: Dynamic type not found: " + typeName); } return new ReadObjectQuery(type.getJavaClass()); }
/** * Helper method to simplify creating a native ReadObjectQuery using the * entity type name (descriptor alias) */ public ReadObjectQuery newReadObjectQuery(String typeName) { DynamicType type = getType(typeName); if (type == null) { throw new IllegalArgumentException("DynamicHelper.createQuery: Dynamic type not found: " + typeName); } return new ReadObjectQuery(type.getJavaClass()); }
/** * INTERNAL: * Extract value from the row and set the attribute to the value in the object. * @since EclipseLink 2.6.0 */ @Override public Object readFromRowIntoObject(XMLRecord row, Object object, AbstractSession executionSession, boolean isTargetProtected) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setSession(executionSession); return readFromRowIntoObject(row, null, object, null, query, executionSession, isTargetProtected); }
/** * INTERNAL: * Extract value from the row and set the attribute to the value in the object. * @since EclipseLink 2.6.0 */ @Override public Object readFromRowIntoObject(XMLRecord row, Object object, AbstractSession executionSession, boolean isTargetProtected) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setSession(executionSession); return readFromRowIntoObject(row, null, object, null, query, executionSession, isTargetProtected); }
protected void populateTargetObjectFromRecord(Vector<DatabaseMapping> mappings, AbstractRecord record, Object targetObject, AbstractSession session) { ReadObjectQuery roq = new ReadObjectQuery(); roq.setSession(session); for (DatabaseMapping dm : mappings) { dm.readFromRowIntoObject(record, null, targetObject, null, roq, session, true); } }
/** * PUBLIC: * Use the example object to consruct a read object query by the objects primary key. * This will read the object from the database with the same primary key as the object * or null if no object is found. */ public Object readObject(Object object) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setSelectionObject(object); query.setIsExecutionClone(true); return executeQuery(query); }
/** * PUBLIC: * Use the example object to consruct a read object query by the objects primary key. * This will read the object from the database with the same primary key as the object * or null if no object is found. */ public Object readObject(Object object) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setSelectionObject(object); query.setIsExecutionClone(true); return executeQuery(query); }
/** * PUBLIC: * Use the example object to consruct a read object query by the objects primary key. * This will read the object from the database with the same primary key as the object * or null if no object is found. */ @Override public Object readObject(Object object) throws DatabaseException { ReadObjectQuery query = new ReadObjectQuery(); query.setSelectionObject(object); query.setIsExecutionClone(true); return executeQuery(query); }
/** * INTERNAL: Generates the read stored procedure for this descriptor */ protected StoredProcedureDefinition generateReadStoredProcedure(ClassDescriptor descriptor) { ReadObjectQuery readQuery = new ReadObjectQuery(); readQuery.setDescriptor(descriptor); readQuery.setReferenceClass(descriptor.getJavaClass()); return generateObjectStoredProcedure(readQuery, descriptor.getPrimaryKeyFields(), "READ_"); }
/** * PUBLIC: * If the PKs were retrieved with the attributes then this method can be used to read the real object from the database. */ public Object readObject(Class javaClass, Session session) { if (getId() == null) { throw QueryException.reportQueryResultWithoutPKs(this); } ReadObjectQuery query = new ReadObjectQuery(javaClass); query.setSelectionId(getId()); return session.executeQuery(query); }
/** * INTERNAL: Generates the read stored procedure for this descriptor */ protected StoredProcedureDefinition generateReadStoredProcedure(ClassDescriptor descriptor) { ReadObjectQuery readQuery = new ReadObjectQuery(); readQuery.setDescriptor(descriptor); readQuery.setReferenceClass(descriptor.getJavaClass()); return generateObjectStoredProcedure(readQuery, descriptor.getPrimaryKeyFields(), "READ_"); }
/** * Build a selection query using the given properties. */ protected ReadObjectQuery getReadObjectQuery(Map properties) { ReadObjectQuery query = new ReadObjectQuery(); // Apply the properties if there are some. QueryHintsHandler.apply(properties, query, this.databaseSession.getDatasourcePlatform().getConversionManager().getLoader(), this.databaseSession); query.setIsExecutionClone(true); return query; }
/** * INTERNAL: Generates the read stored procedure for this descriptor */ protected StoredProcedureDefinition generateReadStoredProcedure(ClassDescriptor descriptor) { ReadObjectQuery readQuery = new ReadObjectQuery(); readQuery.setDescriptor(descriptor); readQuery.setReferenceClass(descriptor.getJavaClass()); return generateObjectStoredProcedure(readQuery, descriptor.getPrimaryKeyFields(), "READ_"); }
/** * PUBLIC: * If the PKs were retrieved with the attributes then this method can be used to read the real object from the database. */ public Object readObject(Class javaClass, Session session) { if (getId() == null) { throw QueryException.reportQueryResultWithoutPKs(this); } ReadObjectQuery query = new ReadObjectQuery(javaClass); query.setSelectionId(getId()); return session.executeQuery(query); }