本文整理汇总了Java中org.hibernate.type.descriptor.ValueBinder类的典型用法代码示例。如果您正苦于以下问题:Java ValueBinder类的具体用法?Java ValueBinder怎么用?Java ValueBinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueBinder类属于org.hibernate.type.descriptor包,在下文中一共展示了ValueBinder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 );
}
};
}
示例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);
}
}
};
}
示例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() );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}
示例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 ) );
}
};
}