| java.lang.Object simpleorm.core.SDataLoader
SDataLoader | public class SDataLoader implements SConstants(Code) | | This class provides simple bulk data loading facilities which are
particularly handy for developing test data. It is used as follows:-
SConnection.rawJDBC("DELETE FROM XX_EMPLOYEE");
SDataLoader empDL = new SDataLoader(Employee.meta);
Employee e1 = (Employee)empDL.insert(new String[]{
"100", "One00", "123 4567", "50000"});
empDL.insert(new String[][]{
{"200", "Two00", "123 4567", "50000"},
{"200", "Two00", "123 4567", "50000"},
{"300", "Three00", "123 4567", "50000"}});
|
SDataLoader | public SDataLoader(SRecordMeta meta, SFieldMeta[] fields)(Code) | | A data loader for record sRecordMeta will load
fields . The primary key fields are always
implicitly included at the beginning and need not be repeated
here. The default for fields is all fields except
those flagged SQY_UNQUERIED .
|
insertRecord | public SRecordInstance insertRecord(Object[] record)(Code) | | Inserts (or updates) one record in the databases, and returns
it. The first element(s) in record contain the
primary key field(s), the rest contain the public
|
insertRecords | public SRecordInstance[] insertRecords(Object[][] records)(Code) | | Conveniently inserts multiple records in one go. Each inner
array is simply passed to insert(String[]) .
|
|
|