/** * ADVANCED: * Set the class type of the field value. * This can be used if field value differs from the object value, * has specific typing requirements such as usage of java.sql.Blob or NChar. * This must be called after the field name has been set. */ public void setFieldClassification(Class fieldType) { getField().setType(fieldType); }
/** * ADVANCED: * Set the class type of the field value. * This can be used if field value differs from the object value, * has specific typing requirements such as usage of java.sql.Blob or NChar. * This must be called after the field name has been set. */ public void setDirectFieldClassification(Class fieldType) { getDirectField().setType(fieldType); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to OUT or INOUT parameter (prefixed with ### or #### in custom SQL string). */ public void setCustomSQLArgumentType(String customParameterName, Class type) { DatabaseField field = new DatabaseField(customParameterName); field.setType(type); getParameters().add(field); getParameterTypes().add(null); }
public InOutputParameterForCallableStatement(Object inParameter, DatabaseField outField, DatabasePlatform platform) { if ((outField.getType() == null) && (inParameter != null)) { DatabaseField typeField = (DatabaseField)outField.clone(); if (inParameter instanceof DatabaseField) { typeField.setType(((DatabaseField)inParameter).getType()); } else { typeField.setType(inParameter.getClass()); } outField = typeField; } obj = outField; prepare(platform); if (inParameter == null) { this.inParameter = getOutputField(); } else { this.inParameter = inParameter; } }
/** * INTERNAL: * It is responsible for initializing the policy properties; */ public void initializeProperties() { DatabaseField dbField = getWriteLockField(); descriptor.buildField(dbField); if (dbField.getType() == null) { //set the default type dbField.setType(getDefaultLockingFieldType()); } Enumeration enumtr = this.getUnmappedFields().elements(); while (enumtr.hasMoreElements()) { DatabaseField lockField; lockField = (DatabaseField)enumtr.nextElement(); descriptor.getFields().addElement(lockField); } }
/** * INTERNAL: * Set the data passed through setCustomSQLArgumentType and useCustomSQLCursorOutputAsResultSet methods. */ protected void afterTranslateCustomQueryUpdateParameter(DatabaseField field, int index, Integer parameterType, Vector updatedParameters, Vector updatedParameterTypes) { for (int j = 0; j < updatedParameters.size(); j++) { DatabaseField updateField = (DatabaseField)updatedParameters.elementAt(j); if (field.equals(updateField)) { Integer updateParameterType = (Integer)updatedParameterTypes.elementAt(j); if (updateParameterType == null) { field.setType(updateField.getType()); } else if (updateParameterType == OUT_CURSOR) { if (parameterType == OUT) { getParameterTypes().setElementAt(OUT_CURSOR, index); } else { throw ValidationException.cannotSetCursorForParameterTypeOtherThanOut(field.getName(), toString()); } } break; } } }
outField.setType(Integer.class); call.appendOut(writer, outField); writer.write(" := ");
/** * INTERNAL: */ protected void processVersion(DatabaseField field) { Class lockType = getRawClass(); field.setType(lockType); if (MetadataHelper.isValidVersionLockingType(lockType)) { m_descriptor.useVersionLockingPolicy(field); } else if (MetadataHelper.isValidTimstampVersionLockingType(lockType)) { m_descriptor.useTimestampLockingPolicy(field); } else { m_validator.throwInvalidTypeForVersionAttribute(getJavaClass(), getAttributeName(), lockType); } }
DatabaseMapping mapping = getObjectBuilder().getMappingForField(field); if (mapping != null) { field.setType(mapping.getFieldClassification(field));
/** * INTERNAL: * Process a discriminator column to set this class indicatior field name * for inheritance. */ protected void processDiscriminatorColumn(MetadataDiscriminatorColumn discriminatorColumn) { DatabaseField field = new DatabaseField(); field.setName(getName(discriminatorColumn.getName(), MetadataDiscriminatorColumn.DEFAULT_NAME, m_logger.DISCRIMINATOR_COLUMN)); field.setLength(discriminatorColumn.getLength()); field.setTableName(m_descriptor.getPrimaryTableName()); field.setColumnDefinition(discriminatorColumn.getColumnDefinition()); field.setType(MetadataHelper.getDiscriminatorType(discriminatorColumn.getDiscriminatorType())); // Set the class indicator field on the inheritance policy. m_descriptor.setClassIndicatorField(field); }
resolvedDatabaseField.setType(resolvedParentField.getType()); resolvedDatabaseField.setScale(resolvedParentField.getScale()); resolvedDatabaseField.setLength(resolvedParentField.getLength());