org.jpox.store.rdbms.mapping.mysql
Class MySQLSpatialRDBMSMapping
java.lang.Object
org.jpox.store.rdbms.mapping.RDBMSMapping
org.jpox.store.rdbms.mapping.ColumnMapping
org.jpox.store.rdbms.mapping.mysql.MySQLSpatialRDBMSMapping
- All Implemented Interfaces:
- org.jpox.store.mapped.mapping.DatastoreMapping
- Direct Known Subclasses:
- GeometryRDBMSMapping, GeometryRDBMSMapping, JGeometryRDBMSMapping
public abstract class MySQLSpatialRDBMSMapping
- extends org.jpox.store.rdbms.mapping.ColumnMapping
Abstract base class for all MySQL spatial mappings. Contains helper methods
that convert WKB (Well Known Binary) data to MySQL spatial objects and vice
versa.
- Version:
- $Revision: 1.1 $
| Fields inherited from class org.jpox.store.rdbms.mapping.ColumnMapping |
column |
| Fields inherited from class org.jpox.store.rdbms.mapping.RDBMSMapping |
LOCALISER, LOCALISER_STORE, mapping, storeMgr |
|
Constructor Summary |
MySQLSpatialRDBMSMapping(org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
org.jpox.store.mapped.MappedStoreManager storeMgr,
org.jpox.store.mapped.DatastoreField field)
|
MySQLSpatialRDBMSMapping(org.jpox.store.mapped.MappedStoreManager storeMgr,
org.jpox.store.mapped.mapping.JavaTypeMapping mapping)
|
|
Method Summary |
protected void |
initialize()
|
protected int |
mysqlBinaryToSrid(byte[] mysqlBinary)
Extracts the SRID of a spatial object in MySQL binary format. |
protected byte[] |
mysqlBinaryToWkb(byte[] mysqlBinary)
Converts a spatial object from MySQL binary format to WKB. |
protected byte[] |
wkbToMysqlBinary(byte[] wkb,
int srid)
Converts a spatial object from WKB to MySQL binary format. |
| Methods inherited from class org.jpox.store.rdbms.mapping.ColumnMapping |
equals, getColumn, getDatastoreField, getInsertionInputParameter, getTypeInfo, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, isStringBased |
| Methods inherited from class org.jpox.store.rdbms.mapping.RDBMSMapping |
failureMessage, getBoolean, getByte, getChar, getDatabaseAdapter, getDouble, getFloat, getInt, getJavaTypeMapping, getLong, getObject, getShort, getString, insertValuesOnInsert, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setShort, setString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
SRID_LENGTH
protected static final int SRID_LENGTH
- See Also:
- Constant Field Values
MySQLSpatialRDBMSMapping
public MySQLSpatialRDBMSMapping(org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
org.jpox.store.mapped.MappedStoreManager storeMgr,
org.jpox.store.mapped.DatastoreField field)
MySQLSpatialRDBMSMapping
public MySQLSpatialRDBMSMapping(org.jpox.store.mapped.MappedStoreManager storeMgr,
org.jpox.store.mapped.mapping.JavaTypeMapping mapping)
initialize
protected void initialize()
mysqlBinaryToWkb
protected byte[] mysqlBinaryToWkb(byte[] mysqlBinary)
throws java.sql.SQLException
- Converts a spatial object from MySQL binary format to WKB.
- Parameters:
mysqlBinary - A spatial object in MySQL binary format.
- Returns:
- The spatial object as WKB.
- Throws:
java.sql.SQLException - If the object contains invalid data.
mysqlBinaryToSrid
protected int mysqlBinaryToSrid(byte[] mysqlBinary)
throws java.sql.SQLException
- Extracts the SRID of a spatial object in MySQL binary format.
- Parameters:
mysqlBinary - A spatial object in MySQL binary format.
- Returns:
- The SRID
- Throws:
java.sql.SQLException - If the object contains invalid data.
wkbToMysqlBinary
protected byte[] wkbToMysqlBinary(byte[] wkb,
int srid)
throws java.sql.SQLException
- Converts a spatial object from WKB to MySQL binary format.
- Parameters:
wkb - A spatial object in WKB format.srid - The SRID of the spatial object.
- Returns:
- The spatial object in MySQL binary format.
- Throws:
java.sql.SQLException - If the object contains invalid data.
Copyright © -2008 . All Rights Reserved.