public class SqlDataWriter extends java.lang.Object implements DataWriter
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoIncrementSupported |
protected SqlDataManager |
dm |
Constructor and Description |
---|
SqlDataWriter(SqlDataManager dm,
java.util.Map lastAutoIncrementValues)
Creates a generic SqlDataWriter that *should* work for most Sql databases
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any connections and frees up any system resources/files
|
void |
finishWriting(java.lang.String finishUp)
finishes up the writing, this is not always required but may be depending on the output The purpose is to write out file footers, and get things cleaned
up in general
|
protected java.util.Map<java.lang.String,DataObject> |
retrieveLastKey(java.sql.PreparedStatement ps,
DataNode n) |
void |
startWriting(java.lang.String startUp)
starts up the writing, this is not always required but may be depending on the output The purpose is to write out file headers, and get things going in
general
|
boolean |
write(RootNode root)
writes the nodes
|
@NotNull protected final SqlDataManager dm
protected boolean autoIncrementSupported
public SqlDataWriter(@NotNull SqlDataManager dm, java.util.Map lastAutoIncrementValues)
dm
- The data manager this writer will write tolastAutoIncrementValues
- The last auto increment values for this writerpublic boolean write(@NotNull RootNode root)
DataWriter
write
in interface DataWriter
root
- The root node to write@NotNull protected java.util.Map<java.lang.String,DataObject> retrieveLastKey(@NotNull java.sql.PreparedStatement ps, @NotNull DataNode n) throws java.sql.SQLException
java.sql.SQLException
public void startWriting(java.lang.String startUp)
DataWriter
startWriting
in interface DataWriter
startUp
- A startup query to run before writingpublic void finishWriting(java.lang.String finishUp)
DataWriter
finishWriting
in interface DataWriter
finishUp
- A closing query to executepublic void close()
DataWriter
close
in interface DataWriter