mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 14:30:16 +00:00
Updates names to reflect switch from JTS to Geolatte.
This commit is contained in:
parent
cf03fe2592
commit
24e7762a3a
@ -68,8 +68,8 @@ public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescript
|
|||||||
return new BasicBinder<X>(javaTypeDescriptor, this){
|
return new BasicBinder<X>(javaTypeDescriptor, this){
|
||||||
@Override
|
@Override
|
||||||
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
|
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
|
||||||
Geometry jtsGeom = getJavaDescriptor().unwrap( value, Geometry.class, options );
|
Geometry geometry = getJavaDescriptor().unwrap( value, Geometry.class, options );
|
||||||
byte[] bytes = Encoders.encode( jtsGeom );
|
byte[] bytes = Encoders.encode( geometry );
|
||||||
st.setObject( index, bytes );
|
st.setObject( index, bytes );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,23 +82,23 @@ public <X> ValueExtractor<X> getExtractor(final JavaTypeDescriptor<X> javaTypeDe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException {
|
protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException {
|
||||||
return getJavaDescriptor().wrap( toJTS( rs.getObject( name ) ), options );
|
return getJavaDescriptor().wrap( toGeometry( rs.getObject( name ) ), options );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected X doExtract(CallableStatement statement, int index, WrapperOptions options) throws SQLException {
|
protected X doExtract(CallableStatement statement, int index, WrapperOptions options) throws SQLException {
|
||||||
return getJavaDescriptor().wrap( toJTS( statement.getObject( index ) ), options );
|
return getJavaDescriptor().wrap( toGeometry( statement.getObject( index ) ), options );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected X doExtract(CallableStatement statement, String name, WrapperOptions options)
|
protected X doExtract(CallableStatement statement, String name, WrapperOptions options)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
return getJavaDescriptor().wrap( toJTS( statement.getObject( name ) ), options );
|
return getJavaDescriptor().wrap( toGeometry( statement.getObject( name ) ), options );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Geometry toJTS(Object obj) {
|
private Geometry toGeometry(Object obj) {
|
||||||
byte[] raw = null;
|
byte[] raw = null;
|
||||||
if ( obj == null ) {
|
if ( obj == null ) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user