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 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(ResultSet rs,
String name,
WrapperOptions options)
throws 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:
SQLException
- Indicates a JDBC error occurred.
doExtract
protected abstract J doExtract(ResultSet rs,
String name,
WrapperOptions options)
throws 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:
SQLException
- Indicates a problem access the result set
Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.