public class SDataLoader<T extends SRecordInstance>
extends java.lang.Object
SDataLoader<Employee> empDL = new SDataLoader(Employee.meta);
Employee e1 = empDL.insert("100", "One00", "123 4567", "50000"});
empDL.insert(new String[][]{ {"200", "Two00", "123 4567", "50000"}, {"200", "Two00", "123 4567", "50000"}, {"300", "Three00", "123 4567", "50000"}});
Constructor and Description |
---|
SDataLoader(SSessionJdbc session,
SRecordMeta<T> meta) |
SDataLoader(SSessionJdbc session,
SRecordMeta<T> meta,
SFieldScalar[] fields)
A data loader for record
sRecordMeta will load fields . |
Modifier and Type | Method and Description |
---|---|
SRecordInstance |
insertRecord(java.lang.Object... record)
Inserts (or updates) one record in the databases, and returns it.
|
SRecordInstance[] |
insertRecords(java.lang.Object[][] records)
Conveniently inserts multiple records in one go.
|
public SDataLoader(SSessionJdbc session, SRecordMeta<T> meta, SFieldScalar[] fields)
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
.public SDataLoader(SSessionJdbc session, SRecordMeta<T> meta)
public SRecordInstance insertRecord(java.lang.Object... record)
record
contain the primary key field(s), the rest contain the publicpublic SRecordInstance[] insertRecords(java.lang.Object[][] records)
insert(String[])
.