Search in sources :

Example 1 with JsonType

use of org.apache.cayenne.access.types.JsonType in project cayenne by apache.

the class DerbyAdapter method configureExtendedTypes.

/**
 * Installs appropriate ExtendedTypes as converters for passing values between JDBC
 * and Java layers.
 */
@Override
protected void configureExtendedTypes(ExtendedTypeMap map) {
    super.configureExtendedTypes(map);
    // create specially configured CharType handler
    CharType charType = new CharType(true, true);
    map.registerType(charType);
    // address Derby driver inability to handle java.lang.Short and java.lang.Byte
    map.registerType(new ShortType(true));
    map.registerType(new ByteType(true));
    map.registerType(new JsonType(charType, true));
}
Also used : JsonType(org.apache.cayenne.access.types.JsonType) ShortType(org.apache.cayenne.access.types.ShortType) CharType(org.apache.cayenne.access.types.CharType) ByteType(org.apache.cayenne.access.types.ByteType)

Example 2 with JsonType

use of org.apache.cayenne.access.types.JsonType in project cayenne by apache.

the class PostgresAdapter method configureExtendedTypes.

/**
 * Installs appropriate ExtendedTypes as converters for passing values
 * between JDBC and Java layers.
 */
@Override
protected void configureExtendedTypes(ExtendedTypeMap map) {
    super.configureExtendedTypes(map);
    CharType charType = new CharType(true, false);
    map.registerType(charType);
    map.registerType(new PostgresByteArrayType(true, true));
    map.registerType(new JsonType(charType, false));
}
Also used : JsonType(org.apache.cayenne.access.types.JsonType) CharType(org.apache.cayenne.access.types.CharType)

Example 3 with JsonType

use of org.apache.cayenne.access.types.JsonType in project cayenne by apache.

the class MySQLAdapter method configureExtendedTypes.

/**
 * Installs appropriate ExtendedTypes used as converters for passing values
 * between JDBC and Java layers.
 */
@Override
protected void configureExtendedTypes(ExtendedTypeMap map) {
    super.configureExtendedTypes(map);
    // must handle CLOBs as strings, otherwise there
    // are problems with NULL clobs that are treated
    // as empty strings... somehow this doesn't happen
    // for BLOBs (ConnectorJ v. 3.0.9)
    CharType charType = new CharType(false, false);
    map.registerType(charType);
    map.registerType(new ByteArrayType(false, false));
    map.registerType(new JsonType(charType, true));
    // register non-default types for the dates, see CAY-2691
    map.registerType(new DateType(true));
    map.registerType(new TimeType(true));
    map.registerType(new TimestampType(true));
    map.registerType(new UtilDateType(true));
}
Also used : JsonType(org.apache.cayenne.access.types.JsonType) ByteArrayType(org.apache.cayenne.access.types.ByteArrayType) TimestampType(org.apache.cayenne.access.types.TimestampType) UtilDateType(org.apache.cayenne.access.types.UtilDateType) CharType(org.apache.cayenne.access.types.CharType) UtilDateType(org.apache.cayenne.access.types.UtilDateType) DateType(org.apache.cayenne.access.types.DateType) TimeType(org.apache.cayenne.access.types.TimeType)

Aggregations

CharType (org.apache.cayenne.access.types.CharType)3 JsonType (org.apache.cayenne.access.types.JsonType)3 ByteArrayType (org.apache.cayenne.access.types.ByteArrayType)1 ByteType (org.apache.cayenne.access.types.ByteType)1 DateType (org.apache.cayenne.access.types.DateType)1 ShortType (org.apache.cayenne.access.types.ShortType)1 TimeType (org.apache.cayenne.access.types.TimeType)1 TimestampType (org.apache.cayenne.access.types.TimestampType)1 UtilDateType (org.apache.cayenne.access.types.UtilDateType)1