public class AttributeConverterSqlTypeDescriptorAdapter extends Object implements SqlTypeDescriptor
Adapter for incorporating JPA AttributeConverter
handling into the SqlTypeDescriptor contract.
<p/>
Essentially this is responsible for mapping to/from the intermediate database type representation. Continuing the
AttributeConverter<Integer,String>
example from
SimpleValue.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.
Constructor and Description |
---|
AttributeConverterSqlTypeDescriptorAdapter(JpaAttributeConverter converter,
SqlTypeDescriptor delegate,
JavaTypeDescriptor intermediateJavaTypeDescriptor) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeRemapped()
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.
|
int |
getSqlType()
Return the JDBC type-code for the column mapped by this type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getJdbcRecommendedJavaTypeMapping
public AttributeConverterSqlTypeDescriptorAdapter(JpaAttributeConverter converter, SqlTypeDescriptor delegate, JavaTypeDescriptor intermediateJavaTypeDescriptor)
public int getSqlType()
SqlTypeDescriptor
Return the JDBC type-code for the column mapped by this type.
getSqlType
in interface SqlTypeDescriptor
public boolean canBeRemapped()
SqlTypeDescriptor
Is this descriptor available for remapping?
canBeRemapped
in interface SqlTypeDescriptor
true
indicates this descriptor can be remapped; otherwise, false
WrapperOptions.remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor)
,
Dialect.remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor)
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor)
SqlTypeDescriptor
Get the binder (setting JDBC in-going parameter values) capable of handling values of the type described by the passed descriptor.
getBinder
in interface SqlTypeDescriptor
javaTypeDescriptor
- The descriptor describing the types of Java values to be boundpublic <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor)
SqlTypeDescriptor
Get the extractor (pulling out-going values from JDBC objects) capable of handling values of the type described by the passed descriptor.
getExtractor
in interface SqlTypeDescriptor
javaTypeDescriptor
- The descriptor describing the types of Java values to be extractedCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.