Java Code Examples for org.hibernate.type.descriptor.ValueExtractor

The following examples show how to use org.hibernate.type.descriptor.ValueExtractor. These examples are extracted from open source projects. 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 Project: hibernate-types   Source File: ArraySqlTypeDescriptor.java    License: 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
@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 Project: lams   Source File: SqlTypeDescriptor.java    License: 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);