Java 类org.hibernate.type.descriptor.ValueBinder 实例源码
项目:lams
文件:AttributeConverterSqlTypeDescriptorAdapter.java
@Override
@SuppressWarnings("unchecked")
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
// Get the binder for the intermediate type representation
final ValueBinder realBinder = delegate.getBinder( intermediateJavaTypeDescriptor );
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
@SuppressWarnings("unchecked")
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
final Object convertedValue;
try {
convertedValue = converter.convertToDatabaseColumn( value );
}
catch (PersistenceException pe) {
throw pe;
}
catch (RuntimeException re) {
throw new PersistenceException( "Error attempting to apply AttributeConverter", re );
}
realBinder.bind( st, convertedValue, index, options );
}
};
}
项目:windup-rulesets
文件:DstSafeDateTypeDescriptor.java
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, (SqlTypeDescriptor) this) {
@Override
protected void doBind(PreparedStatement st, X value, int index,
WrapperOptions options) throws SQLException {
if (cal == null) {
st.setDate(index,
javaTypeDescriptor.unwrap(value, Date.class, options));
} else {
st.setDate(index,
javaTypeDescriptor.unwrap(value, Date.class, options), cal);
}
}
};
}
项目:lams
文件:PostgresUUIDType.java
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setObject( index, javaTypeDescriptor.unwrap( value, UUID.class, options ), getSqlType() );
}
};
}
项目:lams
文件:BooleanTypeDescriptor.java
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setBoolean( index, javaTypeDescriptor.unwrap( value, Boolean.class, options ) );
}
};
}
项目:lams
文件:TimeTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setTime( index, javaTypeDescriptor.unwrap( value, Time.class, options ) );
}
};
}
项目:lams
文件:VarbinaryTypeDescriptor.java
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setBytes( index, javaTypeDescriptor.unwrap( value, byte[].class, options ) );
}
};
}
项目:lams
文件:SqlTypeDescriptorRegistry.java
@Override
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
if ( Serializable.class.isAssignableFrom( javaTypeDescriptor.getJavaTypeClass() ) ) {
return VarbinaryTypeDescriptor.INSTANCE.getBinder( javaTypeDescriptor );
}
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options)
throws SQLException {
st.setObject( index, value, jdbcTypeCode );
}
};
}
项目:lams
文件:BigIntTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setLong( index, javaTypeDescriptor.unwrap( value, Long.class, options ) );
}
};
}
项目:lams
文件:TimestampTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setTimestamp( index, javaTypeDescriptor.unwrap( value, Timestamp.class, options ) );
}
};
}
项目:lams
文件:DoubleTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setDouble( index, javaTypeDescriptor.unwrap( value, Double.class, options ) );
}
};
}
项目:lams
文件:SmallIntTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setShort( index, javaTypeDescriptor.unwrap( value, Short.class, options ) );
}
};
}
项目:lams
文件:DecimalTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setBigDecimal( index, javaTypeDescriptor.unwrap( value, BigDecimal.class, options ) );
}
};
}
项目:lams
文件:RealTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setFloat( index, javaTypeDescriptor.unwrap( value, Float.class, options ) );
}
};
}
项目:lams
文件:IntegerTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setInt( index, javaTypeDescriptor.unwrap( value, Integer.class, options ) );
}
};
}
项目:lams
文件:VarcharTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setString( index, javaTypeDescriptor.unwrap( value, String.class, options ) );
}
};
}
项目:lams
文件:DateTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setDate( index, javaTypeDescriptor.unwrap( value, Date.class, options ) );
}
};
}
项目:lams
文件:NVarcharTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setNString( index, javaTypeDescriptor.unwrap( value, String.class, options ) );
}
};
}
项目:lams
文件:BitTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setBoolean( index, javaTypeDescriptor.unwrap( value, Boolean.class, options ) );
}
};
}
项目:lams
文件:TinyIntTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>( javaTypeDescriptor, this ) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setByte( index, javaTypeDescriptor.unwrap( value, Byte.class, options ) );
}
};
}
项目:hibernate-types
文件:ArraySqlTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
AbstractArrayTypeDescriptor<Object> abstractArrayTypeDescriptor = (AbstractArrayTypeDescriptor<Object>) javaTypeDescriptor;
st.setArray(index, st.getConnection().createArrayOf(
abstractArrayTypeDescriptor.getSqlArrayType(),
abstractArrayTypeDescriptor.unwrap(value, Object[].class, options)
));
}
};
}
项目:hibernate-types
文件:JsonBinarySqlTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setObject(index, javaTypeDescriptor.unwrap(value, JsonNode.class, options), getSqlType());
}
};
}
项目:hibernate-types
文件:JsonStringSqlTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setString(index, javaTypeDescriptor.unwrap(value, String.class, options));
}
};
}
项目:hibernate-types
文件:ArraySqlTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
AbstractArrayTypeDescriptor<Object> abstractArrayTypeDescriptor = (AbstractArrayTypeDescriptor<Object>) javaTypeDescriptor;
st.setArray(index, st.getConnection().createArrayOf(
abstractArrayTypeDescriptor.getSqlArrayType(),
abstractArrayTypeDescriptor.unwrap(value, Object[].class, options)
));
}
};
}
项目:hibernate-types
文件:JsonBinarySqlTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setObject(index, javaTypeDescriptor.unwrap(value, JsonNode.class, options), getSqlType());
}
};
}
项目:hibernate-types
文件:JsonStringSqlTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
st.setString(index, javaTypeDescriptor.unwrap(value, String.class, options));
}
};
}
项目:uimaster
文件:SQLCETypeDescriptor.java
public <X> ValueBinder<X> getBinder(
final JavaTypeDescriptor<X> javaTypeDescriptor) {
return new BasicBinder<X>(javaTypeDescriptor, this) {
@Override
protected void doBind(PreparedStatement st, X value, int index,
WrapperOptions options) throws SQLException {
st.setInt(index, javaTypeDescriptor.unwrap(value,
Integer.class, options));
}
};
}
项目:lams
文件:ClobTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
return getClobBinder( javaTypeDescriptor );
}
项目:lams
文件:NClobTypeDescriptor.java
@Override
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
return getNClobBinder( javaTypeDescriptor );
}
项目:windup-rulesets
文件:CustomSqlDataType.java
@Override
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> arg0)
{
return null;
}
项目:lams
文件:SqlTypeDescriptor.java
/**
* Get the binder (setting JDBC in-going parameter values) capable of handling values of the type described by the
* passed descriptor.
*
* @param javaTypeDescriptor The descriptor describing the types of Java values to be bound
*
* @return The appropriate binder.
*/
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor);