|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jminor.framework.tools.EntityDataUtil
public final class EntityDataUtil
A static helper class for mass data manipulation.
Method Summary | |
---|---|
static void |
batchInsert(EntityConnection connection,
List<Entity> entities,
List<Entity.Key> committed,
int batchSize,
ProgressReporter 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,
String... entityIDs)
Copies the given entities from source to destination |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void copyEntities(EntityConnection source, EntityConnection destination, int batchSize, boolean includePrimaryKeys, 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 ID's of the entity types to copy
DatabaseException
- in case of a db exceptionpublic static void batchInsert(EntityConnection connection, List<Entity> entities, List<Entity.Key> committed, int batchSize, ProgressReporter 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 progress
DatabaseException
- in case of an exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |