com.mizar.persistence.jpa.convert
Class JpaShapeFileWriter

java.lang.Object
  extended by com.mizar.persistence.jpa.convert.JpaShapeFileWriter

public class JpaShapeFileWriter
extends java.lang.Object


Constructor Summary
JpaShapeFileWriter()
           
JpaShapeFileWriter(javax.persistence.EntityManager em, java.util.List list)
           
JpaShapeFileWriter(javax.persistence.EntityManager em, java.util.List list, java.lang.String baseFileName)
           
 
Method Summary
 void close()
           
 com.vividsolutions.jts.geom.LineString createLineString(oracle.spatial.geometry.JGeometry geometry)
           
 com.vividsolutions.jts.geom.MultiPolygon createMultiPolygon(oracle.spatial.geometry.JGeometry geometry)
           
 com.vividsolutions.jts.geom.Point createPoint(oracle.spatial.geometry.JGeometry geometry)
           
 com.vividsolutions.jts.geom.Polygon createPolygon(oracle.spatial.geometry.JGeometry geometry)
           
 int createShapeFile()
           
 java.io.ByteArrayOutputStream getBaos()
           
 java.lang.String getBaseFileName()
           
 int getCommonGeometryType()
           
 JpaDbaseWriter getDbaseCreator()
           
 int getGeometryTypeFilter()
           
 java.util.List getList()
           
 org.geotools.data.shapefile.shp.ShapeType getShapeType()
           
 int getSrid()
           
 java.lang.String getStatus()
           
 int getValidRows()
           
 boolean isHeterogeneousGeometryTypes()
           
 boolean isUseByteArrayOutputStream()
           
static void main(java.lang.String[] args)
           
 void setBaseFileName(java.lang.String fileName)
           
 void setDbaseCreator(JpaDbaseWriter dbaseWriter)
           
 void setGeometryTypeFilter(int geometryTypeFilter)
           
 void setList(java.util.List resultSet)
           
 void setShapeType(org.geotools.data.shapefile.shp.ShapeType shapeType)
           
 void setSrid(int srid)
           
 void setUseByteArrayOutputStream(boolean useByteArrayOutputStream)
           
 int validRows(java.util.List list)
           
 int writeHeader()
           
 boolean writeRow(GeometryBean bean)
           
 int writeRows()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaShapeFileWriter

public JpaShapeFileWriter()

JpaShapeFileWriter

public JpaShapeFileWriter(javax.persistence.EntityManager em,
                          java.util.List list)

JpaShapeFileWriter

public JpaShapeFileWriter(javax.persistence.EntityManager em,
                          java.util.List list,
                          java.lang.String baseFileName)
Parameters:
list - a list of Entity beans
baseFileName - the filename root including the path, but excluding the extention which will be added by this class
Throws:
java.sql.SQLException
Method Detail

createShapeFile

public int createShapeFile()
                    throws java.sql.SQLException,
                           java.io.IOException,
                           org.geotools.data.shapefile.dbf.DbaseFileException
Throws:
java.sql.SQLException
java.io.IOException
org.geotools.data.shapefile.dbf.DbaseFileException

writeHeader

public int writeHeader()
                throws java.sql.SQLException,
                       java.io.IOException,
                       org.geotools.data.shapefile.dbf.DbaseFileException
Throws:
java.sql.SQLException
java.io.IOException
org.geotools.data.shapefile.dbf.DbaseFileException

writeRows

public int writeRows()
              throws java.sql.SQLException,
                     java.io.IOException,
                     org.geotools.data.shapefile.dbf.DbaseFileException
Throws:
java.sql.SQLException
java.io.IOException
org.geotools.data.shapefile.dbf.DbaseFileException

writeRow

public boolean writeRow(GeometryBean bean)
                 throws java.sql.SQLException,
                        java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

createPoint

public com.vividsolutions.jts.geom.Point createPoint(oracle.spatial.geometry.JGeometry geometry)

createLineString

public com.vividsolutions.jts.geom.LineString createLineString(oracle.spatial.geometry.JGeometry geometry)

createPolygon

public com.vividsolutions.jts.geom.Polygon createPolygon(oracle.spatial.geometry.JGeometry geometry)

createMultiPolygon

public com.vividsolutions.jts.geom.MultiPolygon createMultiPolygon(oracle.spatial.geometry.JGeometry geometry)

close

public void close()

validRows

public int validRows(java.util.List list)
              throws java.sql.SQLException
Parameters:
list - a List of GeometryBean
Returns:
the number of rows with valid SDO_GEOMETRY columns
Throws:
java.sql.SQLException

setList

public void setList(java.util.List resultSet)

getList

public java.util.List getList()

setBaseFileName

public void setBaseFileName(java.lang.String fileName)

getBaseFileName

public java.lang.String getBaseFileName()

setDbaseCreator

public void setDbaseCreator(JpaDbaseWriter dbaseWriter)

getDbaseCreator

public JpaDbaseWriter getDbaseCreator()

getValidRows

public int getValidRows()

isHeterogeneousGeometryTypes

public boolean isHeterogeneousGeometryTypes()

getCommonGeometryType

public int getCommonGeometryType()

getStatus

public java.lang.String getStatus()

setSrid

public void setSrid(int srid)

getSrid

public int getSrid()

setUseByteArrayOutputStream

public void setUseByteArrayOutputStream(boolean useByteArrayOutputStream)

isUseByteArrayOutputStream

public boolean isUseByteArrayOutputStream()

getBaos

public java.io.ByteArrayOutputStream getBaos()

setGeometryTypeFilter

public void setGeometryTypeFilter(int geometryTypeFilter)

getGeometryTypeFilter

public int getGeometryTypeFilter()

setShapeType

public void setShapeType(org.geotools.data.shapefile.shp.ShapeType shapeType)

getShapeType

public org.geotools.data.shapefile.shp.ShapeType getShapeType()

main

public static void main(java.lang.String[] args)