public class XmlExportTransformer extends Session.AbstractResultSetReader
Session.ResultSetReader
that writes the read rows into an XML file.Modifier and Type | Class and Description |
---|---|
class |
XmlExportTransformer.TableMapping
Holds XML mapping information.
|
Modifier and Type | Field and Description |
---|---|
static long |
numberOfExportedEntities
Counts the exported entities.
|
static long |
numberOfExportedLOBs
Counts the exported LOBs.
|
Constructor and Description |
---|
XmlExportTransformer(java.io.OutputStream out,
java.lang.String commentHeader,
EntityGraph entityGraph,
java.util.Set<Table> totalProgress,
java.util.Set<Table> cyclicAggregatedTables,
java.lang.String rootTag,
java.lang.String datePattern,
java.lang.String timestampPattern,
Session session,
ScriptFormat scriptFormat,
java.nio.charset.Charset charset,
ExecutionContext executionContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Flushes the export-reader.
|
void |
endDocument()
Closes the XML document.
|
XmlExportTransformer.TableMapping |
getTableMapping(Table table)
Gets the xml mapping for a table.
|
void |
readCurrentRow(java.sql.ResultSet resultSet)
Reads result-set and writes into export-script.
|
void |
setTable(Table table)
Sets the table to read from.
|
void |
setTableIsSubject(boolean tableIsSubject) |
getCellContentConverter, getMetaData, init
public static long numberOfExportedEntities
public static long numberOfExportedLOBs
public XmlExportTransformer(java.io.OutputStream out, java.lang.String commentHeader, EntityGraph entityGraph, java.util.Set<Table> totalProgress, java.util.Set<Table> cyclicAggregatedTables, java.lang.String rootTag, java.lang.String datePattern, java.lang.String timestampPattern, Session session, ScriptFormat scriptFormat, java.nio.charset.Charset charset, ExecutionContext executionContext) throws javax.xml.transform.TransformerConfigurationException, org.xml.sax.SAXException, java.sql.SQLException
out
- to write the xml intocommentHeader
- comment at top of documententityGraph
- the entity graphtotalProgress
- set of all tables for which entities exist in entityGraphrootTag
- root tag namedatePattern
- pattern for datestimestampPattern
- pattern for time-stampsscriptFormat
- java.sql.SQLException
javax.xml.transform.TransformerConfigurationException
org.xml.sax.SAXException
public void readCurrentRow(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the result-setjava.sql.SQLException
public void setTable(Table table)
public void setTableIsSubject(boolean tableIsSubject)
tableIsSubject
- true
iff table is subjectpublic void endDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void close()
close
in interface Session.ResultSetReader
close
in class Session.AbstractResultSetReader
public XmlExportTransformer.TableMapping getTableMapping(Table table) throws org.xml.sax.SAXException, java.io.IOException
table
- the tableorg.xml.sax.SAXException
java.io.IOException