DatabaseRecord recordWithValues= new DatabaseRecord(); recordWithValues.add(new DatabaseField("param1"), "someValue"); String sqlStringWithArgs = databaseQuery.getTranslatedSQLString(session, recordWithValues);
/** * PUBLIC: * Set the database column or query parameter to partition queries by. * This is the table column name, not the class attribute name. * The column value must be included in the query and should normally be part of the object's Id. * This can also be the name of a query parameter. * If a query does not contain the field the query will not be partitioned. */ public void setPartitionField(String partitionField) { this.partitionField = new DatabaseField(partitionField); }
/** * PUBLIC: * Define the source foreign key relationship in the one-to-one mapping. * This method is used to add foreign key relationships to the mapping. * Both the source foreign key field name and the corresponding * target primary key field name must be specified. */ public void addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName) { this.addForeignKeyField(new DatabaseField(sourceForeignKeyFieldName), new DatabaseField(targetKeyFieldName)); }
/** * PUBLIC: * Add the fields in the intermediate table that corresponds to the primary * key in the source table. This method is used if the keys are composite. */ public void addSourceRelationKeyFieldName(String sourceRelationKeyFieldName, String sourcePrimaryKeyFieldName) { addSourceRelationKeyField(new DatabaseField(sourceRelationKeyFieldName), new DatabaseField(sourcePrimaryKeyFieldName)); }
/** * PUBLIC: * Set the field name for the query key. */ public void setFieldName(String fieldName) { setField(new DatabaseField(fieldName)); } }
/** * PUBLIC: * Add a field name translation that maps from a field name in the * source table to a field name in the aggregate descriptor. */ public void addFieldNameTranslation(String sourceFieldName, String aggregateFieldName) { // 322233 - changed to store the sourceField instead of sourceFieldName addFieldTranslation(new DatabaseField(sourceFieldName), aggregateFieldName); }
/** * PUBLIC: * Set the source key field in the relation table. * This is the name of the foreign key in the relation table to the source's primary key field. * This method is used if the source primary key is a singleton only. */ public void setSourceRelationKeyFieldName(String sourceRelationKeyFieldName) { getSourceRelationKeyFields().addElement(new DatabaseField(sourceRelationKeyFieldName)); }
/** * PUBLIC: * Set the direct field name in the reference table. * This is the field that the primitive data value is stored in. */ public void setDirectFieldName(String fieldName) { setDirectField(new DatabaseField(fieldName)); }
/** * PUBLIC: * Add the name of field and the name of the method * that returns the value to be placed in said field * when the object is written to the database. * The method may take zero arguments, or it may * take a single argument of type * <code>org.eclipse.persistence.sessions.Session</code>. */ public void addFieldTransformation(String fieldName, String methodName) { addFieldTransformation(new DatabaseField(fieldName), methodName); }
/** * PUBLIC: * This method sets the name of the typeField of the mapping. * The type field is used to store the type of object the relationship is referencing. */ public void setTypeFieldName(String typeFieldName) { setTypeField(new DatabaseField(typeFieldName)); }
/** * PUBLIC: * Define the field/argument name to be substitute for the index output argument. * This must be called in the order of the output arguments in the result indexed record. * The argumentFieldName is the field or argument name in the descriptor that maps to the indexed value. */ public void addOutputArgument(String argumentFieldName) { getOutputArguments().addElement(new DatabaseField(argumentFieldName)); }
/** * PUBLIC: * Set the write lock field name. * @param writeLockFieldName the name of the field to lock against. */ public void setWriteLockFieldName(String writeLockFieldName) { setWriteLockField(new DatabaseField(writeLockFieldName)); }
@Override public Expression getField(String fieldName) { DatabaseField field = new DatabaseField(fieldName); return getField(field); }
/** * PUBLIC: * Set the target foregin key field names associated with the mapping. * These must be in-order with the sourceKeyFieldNames. */ public void setTargetForeignKeyFieldNames(Vector fieldNames) { Vector fields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(fieldNames.size()); for (Enumeration fieldNamesEnum = fieldNames.elements(); fieldNamesEnum.hasMoreElements();) { fields.addElement(new DatabaseField((String)fieldNamesEnum.nextElement())); } setTargetForeignKeyFields(fields); }
/** * PUBLIC: * Set the source relation key field names associated with the mapping. * These must be in-order with the sourceKeyFieldNames. */ public void setSourceRelationKeyFieldNames(Vector fieldNames) { Vector fields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(fieldNames.size()); for (Enumeration fieldNamesEnum = fieldNames.elements(); fieldNamesEnum.hasMoreElements();) { fields.addElement(new DatabaseField((String)fieldNamesEnum.nextElement())); } setSourceRelationKeyFields(fields); }
/** * INTERNAL: * Set the source key field names associated with the mapping. * These must be in-order with the referenceKeyFieldNames. */ public void setSourceKeyFieldNames(Vector fieldNames) { Vector fields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(fieldNames.size()); for (Enumeration fieldNamesEnum = fieldNames.elements(); fieldNamesEnum.hasMoreElements();) { fields.addElement(new DatabaseField((String)fieldNamesEnum.nextElement())); } setSourceKeyFields(fields); }
/** * PUBLIC: * Define the output argument to the interaction and the field/argument name to be substitute for it. * This is only required if an output row is not used. * The parameterName is the name of the output record argument expected. * The argumentFieldName is the field or argument name to be used to be used for it. * If these names are the same (as they normally are) this method can be called with a single argument. */ public void addOutputArgument(String parameterName, String argumentFieldName) { getOutputArgumentNames().addElement(parameterName); getOutputArguments().addElement(new DatabaseField(argumentFieldName)); }
/** * PUBLIC: * Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out. * The procedureParameterAndArgumentFieldName is the name of the procedure argument expected, * the field or argument name to be used to pass to the procedure and, * the field or argument name to be used is the result of the output row. */ public void addNamedInOutputArgument(String procedureParameterAndArgumentFieldName) { getProcedureArgumentNames().add(procedureParameterAndArgumentFieldName); appendInOut(new DatabaseField(procedureParameterAndArgumentFieldName)); }
/** * PUBLIC: * Define the field/argument name to be substitute for the index argument. * This method is used if the procedure is not named and the order is explicit, names must be added in the correct order. * The argumentFieldName is the field or argument name to be used to pass to the procedure. */ public void addUnamedArgument(String argumentFieldName) { getProcedureArgumentNames().add(null); DatabaseField field = new DatabaseField(argumentFieldName); appendIn(field); }
/** * ADVANCED: * Add the cursor output parameter to the procedure. * This is used for procedures that have multiple cursor output parameters. * If the procedure has a single cursor output parameter, then useNamedCursorOutputAsResultSet() should be used. */ public void addUnnamedCursorOutputArgument(String outputRowFieldName) { getProcedureArgumentNames().add(null); appendOutCursor(new DatabaseField(outputRowFieldName)); }