public final class EntityConnections
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
batchInsert(EntityConnection connection,
java.util.List<Entity> entities,
java.util.List<Entity.Key> committed,
int batchSize,
EventDataListener<java.lang.Integer> progressReporter)
Inserts the given entities, performing a commit after each
batchSize number of inserts. |
static void |
copyEntities(EntityConnection source,
EntityConnection destination,
int batchSize,
boolean includePrimaryKeys,
java.lang.String... entityIds)
Copies the given entities from source to destination
|
public static void copyEntities(EntityConnection source, EntityConnection destination, int batchSize, boolean includePrimaryKeys, java.lang.String... entityIds) throws DatabaseException
source
- the source dbdestination
- the destination dbbatchSize
- the number of records to copy between commitsincludePrimaryKeys
- if true primary key values are included, if false then they are assumed to be auto-generatedentityIds
- the IDs of the entity types to copyDatabaseException
- in case of a db exceptionjava.lang.IllegalArgumentException
- if batchSize
is not a positive integerpublic static void batchInsert(EntityConnection connection, java.util.List<Entity> entities, java.util.List<Entity.Key> committed, int batchSize, EventDataListener<java.lang.Integer> progressReporter) throws DatabaseException
batchSize
number of inserts.connection
- the entity connection to use when insertingentities
- the entities to insertcommitted
- after the call this list will contain the primary keys of successfully inserted entitiesbatchSize
- the commit batch sizeprogressReporter
- if specified this will be used to report batch progressDatabaseException
- in case of an exceptionjava.lang.IllegalArgumentException
- if batchSize
is not a positive integer