public static final <T> DataType<T> getDataType(SQLDialect dialect, Class<T> type) { return getDataType(dialect, type, null); }
/** * Convert a type name (using precision and scale) into a Java class */ public static final Class<?> getType(SQLDialect dialect, String t, int p, int s) throws SQLDialectNotSupportedException { return getDataType(dialect, t, p, s).getType(); }
@Override public String getBaseTypeName() { return DefaultDataType.getDataType(dialect, type.getComponentType()).getTypeName(); }
/** * Convert a type name (using precision and scale) into a Java class */ public static Class<?> getType(SQLDialect dialect, String t, int p, int s) throws SQLDialectNotSupportedException { return getDataType(dialect, t, p, s).getType(); }
@Override public String getTypeName(Configuration configuration) { return getDataType(configuration).getTypeName(); }
@Override public String getCastTypeName(Configuration configuration) { return getDataType(configuration).getCastTypeName(); }
/** * Convert a type name (using precision and scale) into a Java class */ public static final DataType<?> getDataType(SQLDialect dialect, String t, int p, int s) throws SQLDialectNotSupportedException { DataType<?> result = DefaultDataType.getDataType(dialect, t); if (result.getType() == BigDecimal.class) result = DefaultDataType.getDataType(dialect, getNumericClass(p, s)); return result; }
@Override public final <Z> Field<Z> coerce(Class<Z> type) { return coerce(DefaultDataType.getDataType(null, type)); }
@Override public int getBaseType() { return DefaultDataType.getDataType(dialect, type.getComponentType()).getSQLType(); }
@Override public final <Z> Field<Z> coerce(Class<Z> type) { return coerce(DefaultDataType.getDataType(null, type)); }
@Override public String getBaseTypeName() { return DefaultDataType.getDataType(dialect, type.getComponentType()).getTypeName(); }
@Override public String getTypeName(Configuration configuration) { return getDataType(configuration).getTypeName(); }
@Override public String getCastTypeName(Configuration configuration) { return getDataType(configuration).getCastTypeName(); }
/** * Convert a type name (using precision and scale) into a Java class */ public static DataType<?> getDataType(SQLDialect dialect, String t, int p, int s) throws SQLDialectNotSupportedException { DataType<?> result = DefaultDataType.getDataType(dialect, DefaultDataType.normalise(t)); if (result.getType() == BigDecimal.class) { result = DefaultDataType.getDataType(dialect, getNumericClass(p, s)); } return result; }
public static final DataType<?> getDataType(Database db, String t, int p, int s) { if (db.getForceIntegerTypesOnZeroScaleDecimals()) return DefaultDataType.getDataType(db.getDialect(), t, p, s); DataType<?> result = DefaultDataType.getDataType(db.getDialect(), t); if (result.getType() == BigDecimal.class && s == 0) DefaultDataType.getDataType(db.getDialect(), BigInteger.class); return result; }
/** * Create an unnamed parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static <T> Param<T> param(Class<T> type) { return param(DefaultDataType.getDataType(null, type)); }
@SuppressWarnings("unchecked") @Override public final <Z> Field<Z> cast(Class<Z> type) { // [#2597] Prevent unnecessary casts if (getType() == type) { return (Field<Z>) this; } else { return cast(DefaultDataType.getDataType(null, type)); } }
/** * Create a named parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static <T> Param<T> param(String name, Class<T> type) { return param(name, DefaultDataType.getDataType(null, type)); }
@SuppressWarnings("unchecked") @Override public final <Z> Field<Z> cast(Class<Z> type) { // [#2597] Prevent unnecessary casts if (getType() == type) return (Field<Z>) this; else return cast(DefaultDataType.getDataType(null, type)); }
/** * Create a named parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static <T> Param<T> param(String name, Class<T> type) { return param(name, DefaultDataType.getDataType(null, type)); }