Package org.hibernate.spatial
Class JTSGeometryJavaType
- java.lang.Object
-
- org.hibernate.type.descriptor.java.AbstractJavaType<org.locationtech.jts.geom.Geometry>
-
- org.hibernate.spatial.JTSGeometryJavaType
-
- All Implemented Interfaces:
Serializable
,BasicJavaType<org.locationtech.jts.geom.Geometry>
,JavaType<org.locationtech.jts.geom.Geometry>
public class JTSGeometryJavaType extends AbstractJavaType<org.locationtech.jts.geom.Geometry>
Descriptor for JTSGeometry
s.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
-
Field Summary
Fields Modifier and Type Field Description static JTSGeometryJavaType
GEOMETRY_INSTANCE
An instance of this descriptorstatic JTSGeometryJavaType
GEOMETRYCOLL_INSTANCE
static JTSGeometryJavaType
LINESTRING_INSTANCE
static JTSGeometryJavaType
MULTILINESTRING_INSTANCE
static JTSGeometryJavaType
MULTIPOINT_INSTANCE
static JTSGeometryJavaType
MULTIPOLYGON_INSTANCE
static JTSGeometryJavaType
POINT_INSTANCE
static JTSGeometryJavaType
POLYGON_INSTANCE
-
Constructor Summary
Constructors Constructor Description JTSGeometryJavaType(Class<? extends org.locationtech.jts.geom.Geometry> type)
Initialize a type descriptor for the geolatte-geomGeometry
type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areEqual(org.locationtech.jts.geom.Geometry one, org.locationtech.jts.geom.Geometry another)
Determine if two instances are equalorg.locationtech.jts.geom.Geometry
fromString(CharSequence string)
JdbcType
getRecommendedJdbcType(JdbcTypeIndicators indicators)
Obtain the "recommended"SQL type descriptor
for this Java type.String
toString(org.locationtech.jts.geom.Geometry value)
<X> X
unwrap(org.locationtech.jts.geom.Geometry value, Class<X> type, WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type.<X> org.locationtech.jts.geom.Geometry
wrap(X value, WrapperOptions options)
Wrap a value as our handled Java type.-
Methods inherited from class org.hibernate.type.descriptor.java.AbstractJavaType
extractHashCode, extractLoggableRepresentation, getComparator, getJavaType, getMutabilityPlan, unknownUnwrap, unknownWrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaType
appendEncodedString, coerce, createJavaType, createJavaType, fromEncodedString, getCheckCondition, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultValue, getJavaTypeClass, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, isWider
-
-
-
-
Field Detail
-
GEOMETRY_INSTANCE
public static final JTSGeometryJavaType GEOMETRY_INSTANCE
An instance of this descriptor
-
POINT_INSTANCE
public static final JTSGeometryJavaType POINT_INSTANCE
-
LINESTRING_INSTANCE
public static final JTSGeometryJavaType LINESTRING_INSTANCE
-
POLYGON_INSTANCE
public static final JTSGeometryJavaType POLYGON_INSTANCE
-
GEOMETRYCOLL_INSTANCE
public static final JTSGeometryJavaType GEOMETRYCOLL_INSTANCE
-
MULTIPOINT_INSTANCE
public static final JTSGeometryJavaType MULTIPOINT_INSTANCE
-
MULTILINESTRING_INSTANCE
public static final JTSGeometryJavaType MULTILINESTRING_INSTANCE
-
MULTIPOLYGON_INSTANCE
public static final JTSGeometryJavaType MULTIPOLYGON_INSTANCE
-
-
Constructor Detail
-
JTSGeometryJavaType
public JTSGeometryJavaType(Class<? extends org.locationtech.jts.geom.Geometry> type)
Initialize a type descriptor for the geolatte-geomGeometry
type.
-
-
Method Detail
-
toString
public String toString(org.locationtech.jts.geom.Geometry value)
-
fromString
public org.locationtech.jts.geom.Geometry fromString(CharSequence string)
-
getRecommendedJdbcType
public JdbcType getRecommendedJdbcType(JdbcTypeIndicators indicators)
Description copied from interface:BasicJavaType
Obtain the "recommended"SQL type descriptor
for this Java type. Often, but not always, the source of this recommendation is the JDBC specification.- Parameters:
indicators
- Contextual information- Returns:
- The recommended SQL type descriptor
-
areEqual
public boolean areEqual(org.locationtech.jts.geom.Geometry one, org.locationtech.jts.geom.Geometry another)
Description copied from interface:JavaType
Determine if two instances are equal- Specified by:
areEqual
in interfaceJavaType<org.locationtech.jts.geom.Geometry>
- Overrides:
areEqual
in classAbstractJavaType<org.locationtech.jts.geom.Geometry>
- Parameters:
one
- One instanceanother
- The other instance- Returns:
- True if the two are considered equal; false otherwise.
-
unwrap
public <X> X unwrap(org.locationtech.jts.geom.Geometry value, Class<X> type, WrapperOptions options)
Description copied from interface:JavaType
Unwrap an instance of our handled Java type into the requested type.As an example, if this is a
JavaType<Integer>
and we are asked to unwrap theInteger value
as aLong
, we would return something likeLong.valueOf( value.longValue() )
.Intended use is during
PreparedStatement
binding.- Type Parameters:
X
- The conversion type.- Parameters:
value
- The value to unwraptype
- The type as which to unwrapoptions
- The options- Returns:
- The unwrapped value.
-
wrap
public <X> org.locationtech.jts.geom.Geometry wrap(X value, WrapperOptions options)
Description copied from interface:JavaType
Wrap a value as our handled Java type.Intended use is during
ResultSet
extraction.- Type Parameters:
X
- The conversion type.- Parameters:
value
- The value to wrap.options
- The options- Returns:
- The wrapped value.
-
-