@Override protected void setNullFromDatabaseField(DatabaseField databaseField, PreparedStatement statement, int index) throws SQLException { int jdbcType = databaseField.getSqlType(); if (jdbcType == DatabaseField.NULL_SQL_TYPE) { jdbcType = statement.getParameterMetaData().getParameterType(index); } statement.setNull(index, jdbcType); }
@Override protected void setNullFromDatabaseField(DatabaseField databaseField, PreparedStatement statement, int index) throws SQLException { int jdbcType = databaseField.getSqlType(); if (jdbcType == DatabaseField.NULL_SQL_TYPE) { jdbcType = statement.getParameterMetaData().getParameterType(index); } statement.setNull(index, jdbcType); }
public boolean shouldUseCustomModifyForCall(DatabaseField field) { return (field.getSqlType() == Types.STRUCT && (typeConverters != null && typeConverters.containsKey(field.getType()))) || super.shouldUseCustomModifyForCall(field); }
@Override public boolean shouldUseCustomModifyForCall(DatabaseField field) { return (field.getSqlType() == Types.STRUCT && (typeConverters != null && typeConverters.containsKey(field.getType()))) || super.shouldUseCustomModifyForCall(field); }
public boolean shouldUseCustomModifyForCall(DatabaseField field) { return (field.getSqlType() == Types.STRUCT && (typeConverters != null && typeConverters.containsKey(field.getType()))) || super.shouldUseCustomModifyForCall(field); }
/** * Return the JDBC type for the given database field. */ public int getJDBCType(DatabaseField field) { if (field != null) { // If the field has a specified JDBC type, use it, // otherwise compute the type from the Java class type. if (field.getSqlType() != DatabaseField.NULL_SQL_TYPE) { return field.getSqlType(); } else { return getJDBCType(ConversionManager.getObjectClass(field.getType())); } } else { return getJDBCType((Class)null); } }
/** * Return the JDBC type for the given database field. */ public int getJDBCType(DatabaseField field) { if (field != null) { // If the field has a specified JDBC type, use it, // otherwise compute the type from the Java class type. if (field.getSqlType() != DatabaseField.NULL_SQL_TYPE) { return field.getSqlType(); } else { return getJDBCType(ConversionManager.getObjectClass(field.getType())); } } else { return getJDBCType((Class)null); } }
/** * Return the JDBC type for the given database field. */ public int getJDBCType(DatabaseField field) { if (field != null) { // If the field has a specified JDBC type, use it, // otherwise compute the type from the Java class type. if (field.getSqlType() != DatabaseField.NULL_SQL_TYPE) { return field.getSqlType(); } else { return getJDBCType(ConversionManager.getObjectClass(field.getType())); } } else { return getJDBCType((Class)null); } }
if (dbField.getSqlType()==Types.STRUCT){ if (!(parameter instanceof Struct)){ ClassDescriptor descriptor=session.getDescriptor(parameter); parameter = Arrays.asList((Object[])parameter); if ((dbField.getSqlType()!=Types.ARRAY)||(parameter instanceof Array) || !(parameter instanceof Collection) ){ return parameter;
if (dbField.getSqlType()==Types.STRUCT){ if (!(parameter instanceof Struct)){ ClassDescriptor descriptor=session.getDescriptor(parameter); parameter = Arrays.asList((Object[])parameter); if ((dbField.getSqlType()!=Types.ARRAY)||(parameter instanceof Array) || !(parameter instanceof Collection) ){ return parameter;
if (dbField.getSqlType()==Types.STRUCT){ if (!(parameter instanceof Struct)){ ClassDescriptor descriptor=session.getDescriptor(parameter); parameter = Arrays.asList((Object[])parameter); if ((dbField.getSqlType()!=Types.ARRAY)||(parameter instanceof Array) || !(parameter instanceof Collection) ){ return parameter;
/** * INTERNAL: * The mapping is initialized with the given session. This mapping is fully * initialized after this. */ @Override public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { session.getIntegrityChecker().handleError(DescriptorException.fieldNameNotSetInMapping(this)); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); // Must unwrap Struct types on WLS. if (getField().getSqlType() == java.sql.Types.STRUCT) { getDescriptor().setIsNativeConnectionRequired(true); } }
@Override public void logDatabaseMapping(final DirectToFieldMapping databaseMapping, final Session session) { logFine(session, "\tmapping.attributeName : {0}", databaseMapping.getAttributeName()); logFine(session, "\tmapping.attributeClassification: {0}", databaseMapping.getAttributeClassification()); logFine(session, "\tmapping.field.name : {0}", databaseMapping.getField().getName()); logFine(session, "\tmapping.field.sqlType : {0}", databaseMapping.getField().getSqlType()); logFine(session, "\tmapping.field.typeName: {0}", databaseMapping.getField().getTypeName()); logFine(session, "\tmapping.field.columnDefinition : {0}", databaseMapping.getField().getColumnDefinition()); logFine(session, "\tmapping.fieldClassfication : {0}", databaseMapping.getFieldClassification()); }
/** * INTERNAL: * The mapping is initialized with the given session. This mapping is fully * initialized after this. */ @Override public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { session.getIntegrityChecker().handleError(DescriptorException.fieldNameNotSetInMapping(this)); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); // Must unwrap Struct types on WLS. if (getField().getSqlType() == java.sql.Types.STRUCT) { getDescriptor().setIsNativeConnectionRequired(true); } }
if ((field.getType() != null) ||(field.getSqlType()!= DatabaseField.NULL_SQL_TYPE)){ value = field; } else if (modifyRow != null) {
/** * INTERNAL: * The mapping is initialized with the given session. * This mapping is fully initialized after this. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { session.getIntegrityChecker().handleError(DescriptorException.fieldNameNotSetInMapping(this)); } if (keyTableForMapKey == null){ setField(getDescriptor().buildField(getField())); } else { setField(getDescriptor().buildField(getField(), keyTableForMapKey)); } setFields(collectFields()); if (getConverter() != null) { getConverter().initialize(this, session); } // Must unwrap Struct types on WLS. if (getField().getSqlType() == java.sql.Types.STRUCT) { getDescriptor().setIsNativeConnectionRequired(true); } }
if ((field.getType() != null) ||(field.getSqlType()!= DatabaseField.NULL_SQL_TYPE)){ value = field; } else if (modifyRow != null) {
if (arrayField != null){ nestedType = arrayField.getNestedTypeField(); if ((nestedType != null) && nestedType.getSqlType()==Types.STRUCT){ ClassDescriptor descriptor = session.getDescriptor(nestedType.getType()); if ((descriptor != null) && (descriptor.isObjectRelationalDataTypeDescriptor())) {
if (getField().getSqlType() == java.sql.Types.STRUCT) { getDescriptor().setIsNativeConnectionRequired(true);
if (getField().getSqlType() == java.sql.Types.STRUCT) { getDescriptor().setIsNativeConnectionRequired(true);