com.mizar.persistence.jpa.convert
Class JpaDbaseWriter

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

public class JpaDbaseWriter
extends java.lang.Object


Field Summary
static int DBF_MAX_CHAR_WIDTH
           
static int DBF_MAX_COLUMN_NAME
           
static char DBF_TYPE_CHAR
           
static char DBF_TYPE_DATE
           
static char DBF_TYPE_LOGICAL
           
static char DBF_TYPE_NUMERIC
           
static char DBFDescriptionLength
           
 
Constructor Summary
JpaDbaseWriter()
           
JpaDbaseWriter(javax.persistence.EntityManager em, java.util.List list)
           
JpaDbaseWriter(javax.persistence.EntityManager em, java.util.List list, java.lang.String baseFileName)
           
 
Method Summary
 void close()
           
 int createDbaseFile()
           
 java.io.ByteArrayOutputStream getBaos()
           
 java.lang.String getBaseFileName()
           
 org.geotools.data.shapefile.dbf.DbaseFileWriter getDbaseFileWriter()
           
 javax.persistence.EntityManager getEm()
           
 java.util.List getList()
           
 boolean isUseByteArrayOutputStream()
           
 void setBaseFileName(java.lang.String baseFileName)
           
 void setDbaseFileWriter(org.geotools.data.shapefile.dbf.DbaseFileWriter dbaseFileWriter)
           
 void setEm(javax.persistence.EntityManager em)
           
 void setList(java.util.List resultSet)
           
 void setUseByteArrayOutputStream(boolean useByteArrayOutputStream)
           
 org.geotools.data.shapefile.dbf.DbaseFileWriter writeDbfHeader(int numberOfRows)
           
 boolean writeRow(java.lang.Object bean)
           
 void writeRows()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBFDescriptionLength

public static final char DBFDescriptionLength
See Also:
Constant Field Values

DBF_TYPE_CHAR

public static final char DBF_TYPE_CHAR
See Also:
Constant Field Values

DBF_TYPE_NUMERIC

public static final char DBF_TYPE_NUMERIC
See Also:
Constant Field Values

DBF_TYPE_DATE

public static final char DBF_TYPE_DATE
See Also:
Constant Field Values

DBF_TYPE_LOGICAL

public static final char DBF_TYPE_LOGICAL
See Also:
Constant Field Values

DBF_MAX_CHAR_WIDTH

public static final int DBF_MAX_CHAR_WIDTH
See Also:
Constant Field Values

DBF_MAX_COLUMN_NAME

public static final int DBF_MAX_COLUMN_NAME
See Also:
Constant Field Values
Constructor Detail

JpaDbaseWriter

public JpaDbaseWriter()

JpaDbaseWriter

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

JpaDbaseWriter

public JpaDbaseWriter(javax.persistence.EntityManager em,
                      java.util.List list,
                      java.lang.String baseFileName)
Method Detail

createDbaseFile

public int createDbaseFile()
                    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

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

writeDbfHeader

public org.geotools.data.shapefile.dbf.DbaseFileWriter writeDbfHeader(int numberOfRows)
                                                               throws java.sql.SQLException,
                                                                      java.io.IOException
Parameters:
numberOfRows - the number of rows that will be written to the DBF file.
Throws:
java.sql.SQLException
java.io.IOException

writeRows

public void 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(java.lang.Object bean)
                 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

setEm

public void setEm(javax.persistence.EntityManager em)

getEm

public javax.persistence.EntityManager getEm()

setList

public void setList(java.util.List resultSet)

getList

public java.util.List getList()

setBaseFileName

public void setBaseFileName(java.lang.String baseFileName)

getBaseFileName

public java.lang.String getBaseFileName()

setDbaseFileWriter

public void setDbaseFileWriter(org.geotools.data.shapefile.dbf.DbaseFileWriter dbaseFileWriter)

getDbaseFileWriter

public org.geotools.data.shapefile.dbf.DbaseFileWriter getDbaseFileWriter()

getBaos

public java.io.ByteArrayOutputStream getBaos()

setUseByteArrayOutputStream

public void setUseByteArrayOutputStream(boolean useByteArrayOutputStream)

isUseByteArrayOutputStream

public boolean isUseByteArrayOutputStream()