本文整理汇总了Java中org.hibernate.type.descriptor.ValueBinder类的典型用法代码示例。如果您正苦于以下问题:Java ValueBinder类的具体用法?Java ValueBinder怎么用?Java ValueBinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueBinder类属于org.hibernate.type.descriptor包,在下文中一共展示了ValueBinder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:AttributeConverterSqlTypeDescriptorAdapter.java
示例2: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
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);
}
}
};
}
开发者ID:windup,项目名称:windup-rulesets,代码行数:17,代码来源:DstSafeDateTypeDescriptor.java
示例3: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
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() );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:PostgresUUIDType.java
示例4: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:BooleanTypeDescriptor.java
示例5: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:TimeTypeDescriptor.java
示例6: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:VarbinaryTypeDescriptor.java
示例7: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SqlTypeDescriptorRegistry.java
示例8: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:BigIntTypeDescriptor.java
示例9: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:TimestampTypeDescriptor.java
示例10: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:DoubleTypeDescriptor.java
示例11: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:SmallIntTypeDescriptor.java
示例12: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:DecimalTypeDescriptor.java
示例13: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:RealTypeDescriptor.java
示例14: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:IntegerTypeDescriptor.java
示例15: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:VarcharTypeDescriptor.java
示例16: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:DateTypeDescriptor.java
示例17: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:NVarcharTypeDescriptor.java
示例18: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:BitTypeDescriptor.java
示例19: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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 ) );
}
};
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:TinyIntTypeDescriptor.java
示例20: getBinder
import org.hibernate.type.descriptor.ValueBinder; //导入依赖的package包/类
@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)
));
}
};
}
开发者ID:vladmihalcea,项目名称:hibernate-types,代码行数:14,代码来源:ArraySqlTypeDescriptor.java
注:本文中的org.hibernate.type.descriptor.ValueBinder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论