Author: adrianc
Date: Tue Jul 27 04:43:19 2010 New Revision: 979528 URL: http://svn.apache.org/viewvc?rev=979528&view=rev Log: Removed the conversion code from the entity engine. It was causing problems with Oracle JDBC drivers. Modified: ofbiz/branches/release10.04/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java Modified: ofbiz/branches/release10.04/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java?rev=979528&r1=979527&r2=979528&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java (original) +++ ofbiz/branches/release10.04/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java Tue Jul 27 04:43:19 2010 @@ -42,8 +42,6 @@ import javax.sql.rowset.serial.SerialClo import javolution.util.FastMap; -import org.ofbiz.base.conversion.Converter; -import org.ofbiz.base.conversion.Converters; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.ObjectType; import org.ofbiz.base.util.UtilGenerics; @@ -488,7 +486,6 @@ public class SqlJdbcUtil { } } - @SuppressWarnings("unchecked") public static void getValue(ResultSet rs, int ind, ModelField curField, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { ModelFieldType mft = modelFieldTypeReader.getModelFieldType(curField.getType()); @@ -497,52 +494,6 @@ public class SqlJdbcUtil { entity.getEntityName() + "." + curField.getName() + "."); } - // ----- Try out the new converter code ----- - - Object sourceObject = null; - try { - sourceObject = rs.getObject(ind); - if (sourceObject == null) { - entity.dangerousSetNoCheckButFast(curField, null); - return; - } - } catch (SQLException e) { - throw new GenericEntityException(e); - } - Class<?> targetClass = mft.getJavaClass(); - if (targetClass != null) { - Class<?> sourceClass = sourceObject.getClass(); - if (targetClass.equals(sourceClass)) { - entity.dangerousSetNoCheckButFast(curField, sourceObject); - return; - } - Converter<Object, Object> converter = (Converter<Object, Object>) mft.getSqlToJavaConverter(); - if (converter == null) { - if (mft.getSqlClass() == null) { - mft.setSqlClass(sourceClass); - } - try { - converter = (Converter<Object, Object>) Converters.getConverter(sourceClass, targetClass); - mft.setSqlToJavaConverter(converter); - } catch (Exception e) { - Debug.logError(e, module); - } - } - if (converter != null) { - try { - entity.dangerousSetNoCheckButFast(curField, converter.convert(sourceObject)); - return; - } catch (ClassCastException e) { - Debug.logError(e.toString(), module); - } catch (Exception e) { - Debug.logError(e, module); - } - } - Debug.logInfo("Unable to convert, falling back on switch statement", module); - } - - // ------------------------------------------ - String fieldType = mft.getJavaType(); try { |
Free forum by Nabble | Edit this page |