public class DBPoint2D extends QueryableDatatype<com.vividsolutions.jts.geom.Point> implements Point2DResult
Use DBPoint2D when the column is a 2 dimensional Point,
ST_Point, or GEOMETRY that represents a point.
Generally DBPoint2D is declared inside your DBRow sub-class as:
@DBColumn public DBPoint2D myPointColumn = new DBPoint2D();
Support DBvolution at Patreon
SORT_ASCENDING, SORT_DESCENDING| Constructor and Description |
|---|
DBPoint2D()
Create an unset undefined DBPoint2D object to represent a Point column or
value.
|
DBPoint2D(com.vividsolutions.jts.geom.Point point)
Create DBpoint2D and set it's value to the JTS
Point provided. |
DBPoint2D(Point2DExpression columnExpression)
Create a DBPoint2D with the column expression specified.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
formatValueForSQLStatement(DBDefinition db)
Returns the value of the object formatted for the database
This should be overridden in each subclass
This method is called by toSQLString after checking for NULLs and should
return a string representation of the object formatted for use within a SQL
select, insert, update, or delete statement.
|
protected com.vividsolutions.jts.geom.Point |
getFromResultSet(DBDefinition database,
ResultSet resultSet,
String fullColumnName)
Returns the correct object from the ResultSet for the QueryableDatatype to
handle.
|
boolean |
getIncludesNull()
Returns TRUE if this expression requires support for possible NULL database
values.
|
String |
getSQLDatatype()
Provides the SQL datatype used by default for this type of object.
|
com.vividsolutions.jts.geom.Point |
getValue()
Gets the current literal value of this queryable data type.
|
boolean |
isAggregator()
Returns TRUE if this expression is an Aggregator like SUM() or LEAST().
|
com.vividsolutions.jts.geom.Point |
jtsPointValue()
Convert the value of this object to a JTS
Point. |
void |
setValue(com.vividsolutions.jts.geom.Point point)
Set the value of this DBPoint2D to the
Point specified. |
protected void |
setValueFromStandardStringEncoding(String encodedValue)
Set the value of this QDT to the value provided from the standard string
encoding of this datatype
|
StringExpression |
stringResult()
Converts the expression into the standard string/character expression
representing the value.
|
clear, copy, equals, formatColumnForSQLStatement, getColumnExpression, getLiteralValue, getOperator, getPreviousSQLValue, getPreviousValue, getPropertyWrapperDefinition, getQueryableDatatypeForExpressionValue, getQueryableDatatypeForObject, getQueryableDatatypeInstance, getSortOrder, getTablesInvolved, hasBeenSet, hasChanged, hasColumnExpression, hashCode, includingNulls, isDefined, isNotNull, isNull, isPurelyFunctional, negateOperator, removeConstraints, setChanged, setColumnExpression, setDefined, setFromResultSet, setLiteralValue, setOperator, setPreviousValue, setSortOrderAscending, setSortOrderDescending, setToNull, setToNull, setUnchanged, setValueToNull, stringValue, toSQLString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcopy, getQueryableDatatypeForExpressionValue, getTablesInvolved, isPurelyFunctional, toSQLStringpublic DBPoint2D()
public DBPoint2D(Point2DExpression columnExpression)
When retrieving this object from the database the expression will be evaluated to provide the value.
columnExpression - public DBPoint2D(com.vividsolutions.jts.geom.Point point)
Point provided.
Equivalent to {code point2D = new DBPoint2D(); point2D.setValue(aPoint);}
point - public void setValue(com.vividsolutions.jts.geom.Point point)
Point specified.
Set values are used to add the value to the database. Without a set value the database entry will be NULL.
point - the value to be set in the database.public com.vividsolutions.jts.geom.Point getValue()
QueryableDatatype
This method will return NULL if the QDT represents a database NULL OR the
field is undefined. Use QueryableDatatype.isNull() and QueryableDatatype.isDefined() to
differentiate the 2 states.
Undefined QDTs represents a QDT that is not a field from the database.
Undefined QDTs are similar to undefined DBRows
Support DBvolution at Patreon
getValue in class QueryableDatatype<com.vividsolutions.jts.geom.Point>public com.vividsolutions.jts.geom.Point jtsPointValue()
Point.
NULL is valid result from this method.
Support DBvolution at Patreon
public String getSQLDatatype()
QueryableDatatypeThis should be overridden in each subclass
Example return value: "VARCHAR(1000)"
Database specific datatypes are provided by the DBDefinition in the method
DBDefinition.getDatabaseDataTypeOfQueryableDatatype(nz.co.gregs.dbvolution.datatypes.QueryableDatatype<?>)
Support DBvolution at Patreon
getSQLDatatype in class QueryableDatatype<com.vividsolutions.jts.geom.Point>protected String formatValueForSQLStatement(DBDefinition db)
QueryableDatatypeformatValueForSQLStatement in class QueryableDatatype<com.vividsolutions.jts.geom.Point>db - db
Support DBvolution at Patreon
protected com.vividsolutions.jts.geom.Point getFromResultSet(DBDefinition database, ResultSet resultSet, String fullColumnName) throws SQLException, IncorrectGeometryReturnedForDatatype
QueryableDatatypegetFromResultSet in class QueryableDatatype<com.vividsolutions.jts.geom.Point>database - databaseresultSet - resultSetfullColumnName - fullColumnName
Support DBvolution at Patreon
SQLException - java.sql.SQLExceptionIncorrectGeometryReturnedForDatatypepublic boolean isAggregator()
DBExpressionSubclasses must implement this method returning TRUE if the expression will combine the results of several rows to produce a result. If the expression relies on subexpressions, then the isAggregator method must return TRUE if the subexpressions include an aggregator.
Aggregators collect several rows together to produce a single result. Examples are MAX, MIN, and AVERAGE.
They are only appropriate in the SELECT clause and generally require the GROUP BY clause to be useful.
Aggregators are used with DBReport. Aggregator expressions are
included in the SELECT clause but excluded from the GROUP BY clause.
Support DBvolution at Patreon
isAggregator in interface DBExpressionpublic boolean getIncludesNull()
ExpressionCanHaveNullValuesSupport DBvolution at Patreon
getIncludesNull in interface ExpressionCanHaveNullValuespublic StringExpression stringResult()
ExpressionHasStandardStringResultNot all types have a standard string/character representation, notably dates.
Please note that this is not the SQL version of the expression
(toSQLString() will provide that),
nor does this provide a String of the value.
To get the string value use the
stringValue method of the
appropriate QDT.
Support DBvolution at Patreon
stringResult in interface ExpressionHasStandardStringResultprotected void setValueFromStandardStringEncoding(String encodedValue)
QueryableDatatypeSubclass writers should ensure that the method handles nulls correctly and throws an exception if an inappropriate value is supplied.
setValueFromStandardStringEncoding in class QueryableDatatype<com.vividsolutions.jts.geom.Point>encodedValue - the value of the QDT in the appropriate encodingCopyright © 2017. All Rights Reserved.