org.hibernate.type.descriptor.ValueExtractor Java Examples

The following examples show how to use org.hibernate.type.descriptor.ValueExtractor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ArraySqlTypeDescriptor.java    From hibernate-types with Apache License 2.0 5 votes vote down vote up
@Override
public <X> ValueExtractor<X> getExtractor(final JavaTypeDescriptor<X> javaTypeDescriptor) {
    return new BasicExtractor<X>(javaTypeDescriptor, this) {
        @Override
        protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException {
            return javaTypeDescriptor.wrap(rs.getArray(name), options);
        }
    };
}
 
Example #2
Source File: AbstractJsonSqlTypeDescriptor.java    From hibernate-types with Apache License 2.0 5 votes vote down vote up
@Override
public <X> ValueExtractor<X> getExtractor(final JavaTypeDescriptor<X> javaTypeDescriptor) {
    return new BasicExtractor<X>(javaTypeDescriptor, this) {
        @Override
        protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException {
            return javaTypeDescriptor.wrap(extractJson(rs, name), options);
        }
    };
}
 
Example #3
Source File: SqlTypeDescriptor.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Get the extractor (pulling out-going values from JDBC objects) capable of handling values of the type described
 * by the passed descriptor.
 *
 * @param javaTypeDescriptor The descriptor describing the types of Java values to be extracted
 *
 * @return The appropriate extractor
 */
<X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor);