Updates names to reflect switch from JTS to Geolatte.

This commit is contained in:
Karel Maesen 2012-10-29 23:21:16 +01:00 committed by Steve Ebersole
parent cf03fe2592
commit 24e7762a3a

View File

@ -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;