Line 55... |
Line 55... |
55 |
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
55 |
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
56 |
import org.apache.poi.ss.usermodel.Row;
|
56 |
import org.apache.poi.ss.usermodel.Row;
|
57 |
|
57 |
|
58 |
public class DataImporter {
|
58 |
public class DataImporter {
|
59 |
private boolean skipFirstLine = true;
|
59 |
private boolean skipFirstLine = true;
|
60 |
private final SQLTable table;
|
60 |
private SQLTable table;
|
61 |
private final Map<Integer, ValueConverter> map = new HashMap<Integer, ValueConverter>();
|
61 |
private final Map<Integer, ValueConverter> map = new HashMap<Integer, ValueConverter>();
|
62 |
private final Map<SQLField, List<Integer>> fieldMap = new HashMap<SQLField, List<Integer>>();
|
62 |
private final Map<SQLField, List<Integer>> fieldMap = new HashMap<SQLField, List<Integer>>();
|
63 |
private final Map<Integer, Constraint> constraints = new HashMap<Integer, Constraint>();
|
63 |
private final Map<Integer, Constraint> constraints = new HashMap<Integer, Constraint>();
|
64 |
private List<SQLField> uniqueField = new ArrayList<SQLField>();
|
64 |
private List<SQLField> uniqueField = new ArrayList<SQLField>();
|
65 |
private List<SQLRowValues> valuesToUpdate = new ArrayList<SQLRowValues>();
|
65 |
private List<SQLRowValues> valuesToUpdate = new ArrayList<SQLRowValues>();
|
66 |
private List<SQLRowValues> valuesToInsert = new ArrayList<SQLRowValues>();
|
66 |
private List<SQLRowValues> valuesToInsert = new ArrayList<SQLRowValues>();
|
67 |
private Map<ValueConverter, SQLField> foreignMap = new HashMap<ValueConverter, SQLField>();
|
67 |
private Map<ValueConverter, SQLField> foreignMap = new HashMap<ValueConverter, SQLField>();
|
68 |
|
68 |
|
- |
|
69 |
public DataImporter() {
|
- |
|
70 |
}
|
- |
|
71 |
|
69 |
public DataImporter(SQLTable table) {
|
72 |
public DataImporter(SQLTable table) {
|
70 |
this.table = table;
|
73 |
this.table = table;
|
71 |
}
|
74 |
}
|
72 |
|
75 |
|
- |
|
76 |
public void setTable(SQLTable table) {
|
- |
|
77 |
this.table = table;
|
- |
|
78 |
}
|
- |
|
79 |
|
73 |
public static void main(String[] args) throws Exception {
|
80 |
public static void main(String[] args) throws Exception {
|
74 |
System.setProperty(SQLBase.STRUCTURE_USE_XML, "true");
|
81 |
System.setProperty(SQLBase.STRUCTURE_USE_XML, "true");
|
75 |
final ComptaPropsConfiguration conf = ComptaPropsConfiguration.create();
|
82 |
final ComptaPropsConfiguration conf = ComptaPropsConfiguration.create();
|
76 |
Configuration.setInstance(conf);
|
83 |
Configuration.setInstance(conf);
|
77 |
try {
|
84 |
try {
|