Class AttributeConverterSqlTypeDescriptorAdapter
- java.lang.Object
-
- org.hibernate.type.descriptor.converter.AttributeConverterSqlTypeDescriptorAdapter
-
- All Implemented Interfaces:
java.io.Serializable,SqlTypeDescriptor
public class AttributeConverterSqlTypeDescriptorAdapter extends java.lang.Object implements SqlTypeDescriptor
Adapter for incorporating JPAAttributeConverterhandling into the SqlTypeDescriptor contract. Essentially this is responsible for mapping to/from the intermediate database type representation. Continuing theAttributeConverter<Integer,String>example fromSimpleValue.buildAttributeConverterTypeAdapter(), the "intermediate database type representation" would be the String representation. So on binding, we convert the incoming Integer to String; on extraction we extract the value as String and convert to Integer.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttributeConverterSqlTypeDescriptorAdapter(JpaAttributeConverter converter, SqlTypeDescriptor delegate, JavaTypeDescriptor intermediateJavaTypeDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeRemapped()Is this descriptor available for remapping?<X> ValueBinder<X>getBinder(JavaTypeDescriptor<X> javaTypeDescriptor)Get the binder (setting JDBC in-going parameter values) capable of handling values of the type described by the passed descriptor.<X> ValueExtractor<X>getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor)Get the extractor (pulling out-going values from JDBC objects) capable of handling values of the type described by the passed descriptor.intgetSqlType()Return the JDBC type-code for the column mapped by this type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.sql.SqlTypeDescriptor
getJdbcRecommendedJavaTypeMapping
-
-
-
-
Constructor Detail
-
AttributeConverterSqlTypeDescriptorAdapter
public AttributeConverterSqlTypeDescriptorAdapter(JpaAttributeConverter converter, SqlTypeDescriptor delegate, JavaTypeDescriptor intermediateJavaTypeDescriptor)
-
-
Method Detail
-
getSqlType
public int getSqlType()
Description copied from interface:SqlTypeDescriptorReturn the JDBC type-code for the column mapped by this type.- Specified by:
getSqlTypein interfaceSqlTypeDescriptor- Returns:
- typeCode The JDBC type-code
-
canBeRemapped
public boolean canBeRemapped()
Description copied from interface:SqlTypeDescriptorIs this descriptor available for remapping?- Specified by:
canBeRemappedin interfaceSqlTypeDescriptor- Returns:
trueindicates this descriptor can be remapped; otherwise,false- See Also:
WrapperOptions.remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor),Dialect.remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor)
-
getBinder
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor)
Description copied from interface:SqlTypeDescriptorGet the binder (setting JDBC in-going parameter values) capable of handling values of the type described by the passed descriptor.- Specified by:
getBinderin interfaceSqlTypeDescriptor- Parameters:
javaTypeDescriptor- The descriptor describing the types of Java values to be bound- Returns:
- The appropriate binder.
-
getExtractor
public <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor)
Description copied from interface:SqlTypeDescriptorGet the extractor (pulling out-going values from JDBC objects) capable of handling values of the type described by the passed descriptor.- Specified by:
getExtractorin interfaceSqlTypeDescriptor- Parameters:
javaTypeDescriptor- The descriptor describing the types of Java values to be extracted- Returns:
- The appropriate extractor
-
-