Search in sources :

Example 1 with ObjectType

use of org.dbflute.s2dao.valuetype.basic.ObjectType in project dbflute-core by dbflute.

the class TnPlainValueTypes method getValueType.

// -----------------------------------------------------
// byJdbcDefType
// -------------
/**
 * @param jdbcDefType The definition type of JDBC.
 * @return The value type. (NotNull)
 */
public ValueType getValueType(int jdbcDefType) {
    // for no entity and so on
    final Class<?> type = getType(jdbcDefType);
    if (type.equals(Object.class)) {
        // uses dynamic object
        ValueType valueType = _dynamicObjectValueTypeMap.get(jdbcDefType);
        if (valueType != null) {
            return valueType;
        }
        synchronized (this) {
            // lock this instance because also used in remove(), ...
            valueType = _dynamicObjectValueTypeMap.get(jdbcDefType);
            if (valueType != null) {
                // or reading might failed by same-time writing
                return valueType;
            }
            final ObjectType objectType = new ObjectType(jdbcDefType);
            _dynamicObjectValueTypeMap.put(jdbcDefType, objectType);
            return objectType;
        }
    } else {
        return getValueType(type);
    }
}
Also used : ObjectType(org.dbflute.s2dao.valuetype.basic.ObjectType) ValueType(org.dbflute.jdbc.ValueType)

Aggregations

ValueType (org.dbflute.jdbc.ValueType)1 ObjectType (org.dbflute.s2dao.valuetype.basic.ObjectType)1