org.hibernate.type.descriptor.sql
Class BasicExtractor<J>
java.lang.Object
org.hibernate.type.descriptor.sql.BasicExtractor<J>
- All Implemented Interfaces:
- ValueExtractor<J>
public abstract class BasicExtractor<J>
- extends java.lang.Object
- implements ValueExtractor<J>
Convenience base implementation of ValueExtractor
- Author:
- Steve Ebersole
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicExtractor
public BasicExtractor(JavaTypeDescriptor<J> javaDescriptor,
SqlTypeDescriptor sqlDescriptor)
getJavaDescriptor
public JavaTypeDescriptor<J> getJavaDescriptor()
getSqlDescriptor
public SqlTypeDescriptor getSqlDescriptor()
extract
public J extract(java.sql.ResultSet rs,
java.lang.String name,
WrapperOptions options)
throws java.sql.SQLException
- Extract value from result set
- Specified by:
extract
in interface ValueExtractor<J>
- Parameters:
rs
- The result set from which to extract the valuename
- The name by which to extract the value from the result setoptions
- The options
- Returns:
- The extracted value
- Throws:
java.sql.SQLException
- Indicates a JDBC error occurred.
doExtract
protected abstract J doExtract(java.sql.ResultSet rs,
java.lang.String name,
WrapperOptions options)
throws java.sql.SQLException
- Perform the extraction.
Called from
extract(java.sql.ResultSet, java.lang.String, org.hibernate.type.descriptor.WrapperOptions)
. Null checking of the value (as well as consulting ResultSet.wasNull()
) is
done there.
- Parameters:
rs
- The result setname
- The value name in the result setoptions
- The binding options
- Returns:
- The extracted value.
- Throws:
java.sql.SQLException
- Indicates a problem access the result set
Copyright © 2013. All Rights Reserved.