public class FastCopyHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
FastCopyHelper.FastCopyBundle
Class that stores a bundle of SQL that will need to be executed in order to perform the copy process.
|
(package private) class |
FastCopyHelper.FastCopyBundleElement
Class that denotes an element of the bundle.
|
(package private) static class |
FastCopyHelper.FastCopyContext
Builder/Context for a
FastCopyHelper. |
(package private) static class |
FastCopyHelper.FastCopyKey
Class that acts as the key for the
fastCopyCache. |
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
ALLOW_UID
Flag used to enable usage of uid for intermediate tables
|
private boolean |
appendMode
Flag that indicates whether copying should be executed in APPEND mode or not.
|
private static java.lang.String |
BEFORE_PK_MAPPING
The name of the db level mapping used intermediary by the copy process for before tables
|
private java.lang.Boolean |
canFastCopy
Variable that stores the result of the
canUseFastCopy function. |
private static java.lang.String |
DST__PK
Name of the field in a database-level pk mapping, which stores a destination pk
|
private java.lang.Class<? extends DataModelObject> |
dstDmoInterface
The DMO interface of the destination.
|
private DmoMeta |
dstMeta
The meta information of the destination.
|
private java.util.List<Property> |
dstSimpleProps
The list of properties specific to the destination temp-table.
|
private java.lang.String |
dstTableName
The destination table name.
|
private java.util.Map<java.lang.Integer,java.util.List<Property[]>> |
extentFields
A collection of extent fields.
|
private FastCopyHelper.FastCopyBundle |
fastCopyBundle
The bundle of SQLs that will be executed to perform the copy process.
|
private boolean |
forceMapping
true if this fast-copy helper will force the creation of an intermediate PK mapping |
private boolean |
generatesPkMapping
Flag set when a database level mapping exists for the copy operation.
|
private boolean |
isBefore
Flag which indicates if the targets are before tables.
|
private static java.lang.String |
LIST__INDEX__TABLE
Name of a generic use intermediate table, used for storing the indexes of an extent
|
private boolean |
looseCopyMode
Flag that indicates if this is a loose copy process.
|
private static java.lang.String |
MASTER_PK_MAPPING
The name of the db level mapping used intermediary by the copy process for master tables
|
private static java.lang.String |
MULTIPLEX_FIELD_NAME
Name of the multiplex ID field in temp table DMO classes
|
private java.lang.String |
pkMappingName
Name of a generic use temporary table, used for intermediary operations.
|
private java.util.Map<RecordBuffer.DatumAccess,RecordBuffer.DatumAccess> |
propsMap
A property mapping in case this is not a simple copy.
|
private boolean |
simpleCopy
Flag which indicates that this is a simpleCopy (no need for property mapping)
|
private java.lang.String |
sort
A cache for the sort clause used when copying tables.
|
private static java.lang.String |
SRC__PK
Name of the field in a database-level pk mapping, which stores a source pk
|
private Dialect |
srcDialect
The dialect of the source.
|
private java.lang.Class<? extends DataModelObject> |
srcDmoInterface
The DMO interface of the source.
|
private java.lang.String |
srcImplicitIndexName
The source index name.
|
private java.lang.String |
srcImplicitSqlIndexName
The source index name used in SQLs.
|
private DmoMeta |
srcMeta
The meta information of the source.
|
private Persistence |
srcPersistence
The persistence of the source.
|
private java.util.List<Property> |
srcSimpleProps
The list of properties specific to the source temp-table.
|
private java.lang.String |
srcTableName
The source table name.
|
private long |
uid
A value used to generate unique names for the tables used for intermediate operations and storing.
|
private static java.util.concurrent.atomic.AtomicLong |
uidCounter
A value used to increment the uid upon instantiation of FastCopyHelper.
|
| Modifier | Constructor and Description |
|---|---|
private |
FastCopyHelper(FastCopyHelper.FastCopyContext fastCopyContext)
Constructor that is based on the context given.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
appendColumnName(DmoMeta srcMeta,
DmoMeta dstMeta,
Property srcProp,
Property dstProp,
java.lang.StringBuilder srcSb,
java.lang.StringBuilder dstSb,
java.util.List<java.lang.Object> args)
A helper method which will append a source and destination property name to correct string builders:
comma separated and having support for datetime-tz data type.
|
private java.lang.String |
assembleUidMapping(java.lang.String property)
Append the
uid value to properties in order to generate
unique names for the temporary and intermediary tables used in operations
or storing indexes, |
(package private) boolean |
canUseFastCopy()
This should be used to determine if this helper can be used in order to execute a fast copy
on the provided temp-tables.
|
(package private) void |
clear(FastCopyHelper.FastCopyContext ctx)
Particular method which clears the intermediate database-level pk mapping for the table copy.
|
private java.util.List<java.lang.String> |
computeUniqueConstraintsClauses(java.util.List<Property> srcSimpleProps,
java.util.List<Property> dstSimpleProps)
Identify a list of where clauses which rule out duplicate records when copying from a source
to a destination.
|
private void |
copyExtentFields(FastCopyHelper.FastCopyContext fastCopyContext)
This method will call for
copyExtentFields(java.util.Map<java.lang.Integer, java.util.List<com.goldencode.p2j.persist.orm.Property[]>>, java.lang.String, long) with table specific parameters. |
private void |
copyExtentFields(java.util.Map<java.lang.Integer,java.util.List<Property[]>> extentFields,
java.lang.String pkMappingTableName,
long uid)
The procedure which handles the copy between extent tables (only when source and destination properties
are both normalized).
|
private void |
copyTable(FastCopyHelper.FastCopyContext fastCopyContext,
boolean loose)
This method will call for
copyTable(com.goldencode.p2j.persist.FastCopyHelper.FastCopyContext, java.util.List<com.goldencode.p2j.persist.orm.Property>, java.util.List<com.goldencode.p2j.persist.orm.Property>, java.lang.String, boolean) with table specific parameters. |
private FastCopyHelper.FastCopyBundleElement |
copyTable(FastCopyHelper.FastCopyContext fastCopyContext,
java.util.List<Property> srcSimpleProps,
java.util.List<Property> dstSimpleProps,
java.lang.String sort,
boolean looseCopy)
The main procedure involved when copying the records from a source to a destination.
|
static void |
createMappings(Persistence persistence)
Create the in-database mappings which are used for intermediary steps in the fast-copy process.
|
private void |
createPkMapping(FastCopyHelper.FastCopyContext fastCopyContext)
This method will call for
createPkMapping(com.goldencode.p2j.persist.FastCopyHelper.FastCopyContext, java.lang.String, java.lang.String, boolean) with table specific parameters. |
private void |
createPkMapping(FastCopyHelper.FastCopyContext fastCopyContext,
java.lang.String sort,
java.lang.String pkMappingTableName,
boolean addToBundle)
This will create a database-level primary key mapping which can be used in other operations
(through join) in order to speed up the copy process.
|
static void |
dropMappings(Session session)
Drop the in-database mappings which are used for intermediary steps in the fast-copy process.
|
(package private) rowid |
executeCopy(FastCopyHelper.FastCopyContext fastCopyContext,
rowid srcRecId)
Performance improved variant, when we know the destination table can have its
records inserted via
INSERT INTO ... |
private rowid |
executeCopyImpl(FastCopyHelper.FastCopyContext fastCopyContext,
rowid srcRecId)
Method used to execute the SQLs for the copy process and, if needed, set the destination rowid.
|
private java.lang.String |
getDstTableSql()
Compute the destination table update SQL.
|
private java.lang.StringBuilder |
getDstTempColumns()
This builds the columns to which the records should be copied.
|
private java.lang.String |
getExtentInsertSql(java.lang.String srcExtent,
java.lang.String dstExtent,
java.lang.String extColumnListSrc,
java.lang.String extColumnListDst,
java.lang.String pkMappingTableName)
A generator method which provides a suitable SQL to insert all records from an extent table
to another based on an in-database primary key mapping.
|
private java.lang.String |
getFastTableCopySql(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String columnListSrc,
java.lang.String columnListDst,
java.lang.String sqlIndexName,
java.lang.String sort)
A generator method which will copy the records from a source table into a destination table.
|
private java.lang.Object |
getInitialValue(DmoMeta meta,
Property prop)
Retrieve the initial value of a certain property.
|
private java.lang.String |
getMappedPropName(java.lang.String propName,
java.util.List<Property> from,
java.util.List<Property> to)
Identify the name of the property in the destination which should match the provided property
from the source.
|
private java.util.Map<java.lang.Long,java.lang.Long[]> |
getMapping(FastCopyHelper.FastCopyContext fastCopyContext)
This method will call for
getMapping(com.goldencode.p2j.persist.Persistence, java.lang.String) with table specific parameters. |
private java.util.Map<java.lang.Long,java.lang.Long[]> |
getMapping(Persistence persistence,
java.lang.String pkMappingTableName)
This will retrieve the database-level pk mapping into a local mapping.
|
private java.lang.String |
getPkMappingSql(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String sqlIndexName,
java.util.List<java.lang.String> extraWhereClauses,
java.lang.String sort,
java.lang.String pkMappingTableName)
A generator method which will create a database-level primary key mapping which can be used
(through join) in order to speed up the copy process.
|
private java.lang.String |
getSafeTableCopySqlNoMapping(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String columnListSrc,
java.lang.String columnListDst,
java.lang.String sqlIndexName,
java.util.List<java.lang.String> extraWhereClauses,
java.lang.String sort)
A generator method which will copy the records from a source table into a destination table
with an additional condition on the recid of the source table.
|
private java.lang.String |
getShadowCopySql(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String columnListSrc,
java.lang.String columnListDst,
java.lang.String sort,
java.lang.String pkMappingTableName)
A generator method which will copy the records from a source table into a destination table
based on an already existing database-level pk mapping.
|
private java.lang.String |
getSimpleExtentInsertSql(int extent,
java.lang.String dstExtent,
java.lang.String extColumnListSrc,
java.lang.String extColumnListDst,
java.lang.String pkMappingTableName,
long uid)
Special generator method which provides a suitable SQL to insert into a destination table
only default values.
|
private java.lang.String |
getSortClause()
This method will call for
getSortClause(java.lang.String) with table specific parameters. |
private java.lang.String |
getSortClause(java.lang.String indexName)
This will return the sort clause which should be used (in case am explicit index name is
provided).
|
private java.lang.StringBuilder |
getSrcMappedColumns(java.lang.String pkMappingTableName)
A particular method which builds the columns from which the records should be copied in a context
where an intermediate database-level pk mapping is used.
|
private java.lang.StringBuilder |
getSrcMappedWildcard(java.lang.String pkMappingTableName,
java.lang.String sourceTableName)
A particular method which builds a wildcard from which the records should be copied in a context
where an intermediate database-level pk mapping is used.
|
private java.lang.StringBuilder |
getSrcTempColumns(java.lang.String dstTableName)
This builds the columns from which the records should be copied.
|
private java.lang.StringBuilder |
getSrcTempWildcard(java.lang.String dstTableName,
java.lang.String sourcetableName)
This builds a wildcard for the given table instead of the columns.
|
private void |
initialize(TemporaryBuffer srcBuf,
TemporaryBuffer dstBuf)
Given the buffers used, initialize the fields that will be required in this class.
|
private boolean |
processProperties()
This extracts information from the source and destination tables.
|
private FastCopyHelper.FastCopyBundleElement |
safeTableCopy(FastCopyHelper.FastCopyContext fastCopyContext,
java.util.List<Property> srcSimpleProps,
java.util.List<Property> dstSimpleProps,
java.lang.String sort,
java.lang.String pkMappingTableName,
boolean looseCopy)
A more complex way to copy a temp-table which ensures that the unique constraints won't
be violated after copy.
|
private FastCopyHelper.FastCopyBundleElement |
safeTableCopyNoMapping(FastCopyHelper.FastCopyContext fastCopyContext,
java.util.List<Property> srcSimpleProps,
java.util.List<Property> dstSimpleProps,
java.lang.String sort,
boolean looseCopy)
Handles the copy of the records from a source to a destination without using
intermediate tables.
|
(package private) static void |
updatePeerRecords(FastCopyHelper masterCopyHelper,
FastCopyHelper.FastCopyContext masterCopyContext,
FastCopyHelper beforeCopyHelper,
FastCopyHelper.FastCopyContext beforeCopyContext)
This method will update the peer values in the master and before tables.
|
private static final java.lang.String MULTIPLEX_FIELD_NAME
private static final java.lang.String LIST__INDEX__TABLE
private static final java.lang.String DST__PK
private static final java.lang.String SRC__PK
private static final java.lang.String MASTER_PK_MAPPING
private static final java.lang.String BEFORE_PK_MAPPING
private static final boolean ALLOW_UID
private static java.util.concurrent.atomic.AtomicLong uidCounter
private final FastCopyHelper.FastCopyBundle fastCopyBundle
private final boolean isBefore
private final boolean simpleCopy
private final boolean appendMode
private final boolean looseCopyMode
private java.lang.Boolean canFastCopy
canUseFastCopy function.private final java.lang.String pkMappingName
private boolean generatesPkMapping
private Persistence srcPersistence
private DmoMeta srcMeta
private DmoMeta dstMeta
private java.lang.Class<? extends DataModelObject> srcDmoInterface
private java.lang.Class<? extends DataModelObject> dstDmoInterface
private Dialect srcDialect
private java.lang.String srcTableName
private java.lang.String dstTableName
private java.lang.String srcImplicitIndexName
private java.lang.String srcImplicitSqlIndexName
private java.util.Map<RecordBuffer.DatumAccess,RecordBuffer.DatumAccess> propsMap
private java.util.List<Property> srcSimpleProps
private java.util.List<Property> dstSimpleProps
private java.util.Map<java.lang.Integer,java.util.List<Property[]>> extentFields
private java.lang.String sort
private long uid
private boolean forceMapping
true if this fast-copy helper will force the creation of an intermediate PK mappingprivate FastCopyHelper(FastCopyHelper.FastCopyContext fastCopyContext)
fastCopyContext - The context that has the information required.public static void createMappings(Persistence persistence)
persistence - The persistence in which the tables should be created.public static void dropMappings(Session session) throws PersistenceException
session - The persistence from which the tables should be dropped.PersistenceException - This is thrown if the persistence layer failsstatic void updatePeerRecords(FastCopyHelper masterCopyHelper, FastCopyHelper.FastCopyContext masterCopyContext, FastCopyHelper beforeCopyHelper, FastCopyHelper.FastCopyContext beforeCopyContext) throws PersistenceException
masterCopyHelper - The master instance that handled the master copy.masterCopyContext - The master context that handled the master copy.beforeCopyHelper - The before instance that handled the before copy.beforeCopyContext - The before context that handled the before copy.PersistenceExceptionrowid executeCopy(FastCopyHelper.FastCopyContext fastCopyContext, rowid srcRecId) throws PersistenceException
INSERT INTO ... SELECT FROM, without having to do any validation on
the records, as the destination table will accept them all.
If the copy bundle is already computed, then this method will simply determine the execution of the
SQLs. Otherwise, It will generate them and then it will execute.fastCopyContext - The context that has the required information.srcRecId - A source record id for which a destination record id should be computed at the end.
If this is null, then null will be returned.null.PersistenceExceptionboolean canUseFastCopy()
true if this helper can be used for fast-copy.void clear(FastCopyHelper.FastCopyContext ctx) throws PersistenceException
ctx - The fast-copy context in which this pk mapping clear is done.PersistenceExceptionprivate void initialize(TemporaryBuffer srcBuf, TemporaryBuffer dstBuf)
srcBuf - The source buffer.dstBuf - The destination buffer.private rowid executeCopyImpl(FastCopyHelper.FastCopyContext fastCopyContext, rowid srcRecId) throws PersistenceException
fastCopyContext - The context with the required information.srcRecId - The rowid of the current record in the source buffer - if not null, it will be set in
the destination buffer, too.rowid.PersistenceExceptionprivate FastCopyHelper.FastCopyBundleElement copyTable(FastCopyHelper.FastCopyContext fastCopyContext, java.util.List<Property> srcSimpleProps, java.util.List<Property> dstSimpleProps, java.lang.String sort, boolean looseCopy)
fastCopyContext - The context that has the required information.srcSimpleProps - A list of properties in the source table.dstSimpleProps - A list of properties in the destination table.sort - The sort clause which should be used when computing the insert SQL.looseCopy - If the copy is in loose mode.private FastCopyHelper.FastCopyBundleElement safeTableCopy(FastCopyHelper.FastCopyContext fastCopyContext, java.util.List<Property> srcSimpleProps, java.util.List<Property> dstSimpleProps, java.lang.String sort, java.lang.String pkMappingTableName, boolean looseCopy)
canUseFastCopy().
This technique uses a pre-copy pk mapping, which means that at first we will have a
preselection of the records from the source. Afterwards, we apply a "shadow" copy, meaning
that we won't check the constraints anymore; we just copy the preselected records from
the source to the destination.
This will create a pk mapping. This won't allow post-copy pk mappings as they won't be safe.fastCopyContext - The context that has the required information.srcSimpleProps - A list of properties in the source table.dstSimpleProps - A list of properties in the destination table.sort - The sort clause which should be used when computing the insert SQL.pkMappingTableName - The name of the intermediate table which will be used for pk mapping.looseCopy - If the copy is in loose mode.private FastCopyHelper.FastCopyBundleElement safeTableCopyNoMapping(FastCopyHelper.FastCopyContext fastCopyContext, java.util.List<Property> srcSimpleProps, java.util.List<Property> dstSimpleProps, java.lang.String sort, boolean looseCopy)
fastCopyContext - The context that has the required information.srcSimpleProps - A list of properties in the source table.dstSimpleProps - A list of properties in the destination table.sort - The sort clause which should be used when computing the insert SQL.looseCopy - If the copy is in loose mode.private java.util.List<java.lang.String> computeUniqueConstraintsClauses(java.util.List<Property> srcSimpleProps, java.util.List<Property> dstSimpleProps)
srcSimpleProps - A list of properties in the source table.dstSimpleProps - A list of properties in the destination table.private java.lang.String getMappedPropName(java.lang.String propName,
java.util.List<Property> from,
java.util.List<Property> to)
propName - The property name for which we search a correspondent.from - The list of properties for the DMO containing the provided property name.to - The list of properties in which we search for a correspondent.private void copyExtentFields(java.util.Map<java.lang.Integer,java.util.List<Property[]>> extentFields, java.lang.String pkMappingTableName, long uid)
extentFields - The mapping between the source extent fields and destination extent fields. This mapping
is done per extent value.pkMappingTableName - The name of the table which will be used as a database level primary key mapping.uid - Value used to generate unique names for intermediate tables.private void createPkMapping(FastCopyHelper.FastCopyContext fastCopyContext, java.lang.String sort, java.lang.String pkMappingTableName, boolean addToBundle) throws PersistenceException
fastCopyContext - The context that has the required information.sort - The sort clause used when the records were copied between main tables.pkMappingTableName - The name which should be used by the table which will store the primary key mapping.
This does not check if the pkMappingTableName already exists.addToBundle - true if instead of immediately executing the SQLs, they can be added to the bundle
and be executed at the end, false otherwise.PersistenceExceptionprivate java.lang.String getExtentInsertSql(java.lang.String srcExtent,
java.lang.String dstExtent,
java.lang.String extColumnListSrc,
java.lang.String extColumnListDst,
java.lang.String pkMappingTableName)
srcExtent - The name of the source extent temp-table.dstExtent - The name of the destination extent temp-table.extColumnListSrc - A string containing the columns from which the copy should be done.extColumnListDst - A string containing the columns to which the copy should be done.pkMappingTableName - The name of the table which stores the primary key mapping.private java.lang.String getSimpleExtentInsertSql(int extent,
java.lang.String dstExtent,
java.lang.String extColumnListSrc,
java.lang.String extColumnListDst,
java.lang.String pkMappingTableName,
long uid)
extent - The size of the extent for which the insert sql should be generated.dstExtent - The name of the destination extent table.extColumnListSrc - A list of fields from which the copy should be done. This should be formed only by ?,
which will be set on the default values.extColumnListDst - A list of the names of the extent field properties in the destination.pkMappingTableName - The name of the in database pk mapping from which the parent-id will be extracted.uid - Value used to generate unique names for intermediate tables.private java.lang.String getPkMappingSql(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String sqlIndexName,
java.util.List<java.lang.String> extraWhereClauses,
java.lang.String sort,
java.lang.String pkMappingTableName)
srcTable - The name of the source table.dstTable - The name of the destination table.sqlIndexName - The SQL name of the index used in the main table copy processextraWhereClauses - A list of extra where clauses that need to be appended.sort - The sort clause used in the main table copy process.pkMappingTableName - The name which should be used for the generated table.private java.lang.String getShadowCopySql(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String columnListSrc,
java.lang.String columnListDst,
java.lang.String sort,
java.lang.String pkMappingTableName)
srcTable - The name of the source table.dstTable - the name of the destination table.columnListSrc - A string containing the columns from which the copy should be done.columnListDst - A string containing the columns to which the copy should be done.sort - The sort clausepkMappingTableName - The table which contains the pk mapping.private java.lang.String getFastTableCopySql(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String columnListSrc,
java.lang.String columnListDst,
java.lang.String sqlIndexName,
java.lang.String sort)
srcTable - The name of the source table.dstTable - the name of the destination table.columnListSrc - A string containing the columns from which the copy should be done.columnListDst - A string containing the columns to which the copy should be done.sqlIndexName - The name of the index which should be used when copying records.sort - The sort clause.private java.lang.String getSafeTableCopySqlNoMapping(java.lang.String srcTable,
java.lang.String dstTable,
java.lang.String columnListSrc,
java.lang.String columnListDst,
java.lang.String sqlIndexName,
java.util.List<java.lang.String> extraWhereClauses,
java.lang.String sort)
srcTable - The name of the source table.dstTable - the name of the destination table.columnListSrc - A string containing the columns from which the copy should be done.columnListDst - A string containing the columns to which the copy should be done.sqlIndexName - The name of the index which should be used when copying records.extraWhereClauses - Other where clauses to be included. Used to implement append-mode.sort - The sort clause.private java.lang.StringBuilder getSrcTempColumns(java.lang.String dstTableName)
dstTableName - The name of the destination table. This is used to use the NEXT PK functionality.private java.lang.StringBuilder getSrcTempWildcard(java.lang.String dstTableName,
java.lang.String sourcetableName)
dstTableName - The name of the destination table. This is used to use the NEXT PK functionality.sourcetableName - The name of the source table.private java.lang.StringBuilder getSrcMappedColumns(java.lang.String pkMappingTableName)
pkMappingTableName - The database-level pk mapping which is used when doing the copy.private java.lang.StringBuilder getSrcMappedWildcard(java.lang.String pkMappingTableName,
java.lang.String sourceTableName)
pkMappingTableName - The database-level pk mapping which is used when doing the copy.sourceTableName - The name of the source table.private java.lang.StringBuilder getDstTempColumns()
private boolean processProperties()
true if the processing didn't required loose-mode, so that the order of
the properties in the source matches the one in the destination.private void appendColumnName(DmoMeta srcMeta, DmoMeta dstMeta, Property srcProp, Property dstProp, java.lang.StringBuilder srcSb, java.lang.StringBuilder dstSb, java.util.List<java.lang.Object> args)
srcMeta - The dmo meta of the source.dstMeta - The dmo meta of the destination. Used to retrieve eventual initial values.srcProp - The source property which should be appended to the list of source fields.dstProp - The destination property which should be appended to the list of source fields.srcSb - The string builder which shall hold the information about the source fields.dstSb - The string builder which shall hold the information about the destination fields.args - The list of parameters which will be used in the SQL. Here the default will be appended
if needed.private java.lang.String getSortClause(java.lang.String indexName)
throws PersistenceException
indexName - The index which should be taken in consideration when computing the sort clause.
This can be null, resulting in a default sort clause.PersistenceExceptionprivate java.util.Map<java.lang.Long,java.lang.Long[]> getMapping(Persistence persistence, java.lang.String pkMappingTableName) throws PersistenceException
persistence - A persistence instance which should be used in order to retrieve the database-level
pk mapping.pkMappingTableName - The name of the table which stored the database-level pk mapping.PersistenceExceptionprivate java.lang.Object getInitialValue(DmoMeta meta, Property prop)
meta - The meta of the dmo for the provided property.prop - The property for which the initial value should be retrieved.private void copyTable(FastCopyHelper.FastCopyContext fastCopyContext, boolean loose) throws PersistenceException
copyTable(com.goldencode.p2j.persist.FastCopyHelper.FastCopyContext, java.util.List<com.goldencode.p2j.persist.orm.Property>, java.util.List<com.goldencode.p2j.persist.orm.Property>, java.lang.String, boolean) with table specific parameters. Also this
will trigger processProperties() which will analyze the tables and compute
a list of their properties (and extents) in a copy suitable order.fastCopyContext - The context that has the information required.loose - If the copy is in loose mode.PersistenceExceptionprivate java.lang.String getSortClause()
throws PersistenceException
getSortClause(java.lang.String) with table specific parameters. This will
also cache the sort clause.PersistenceExceptionprivate java.lang.String getDstTableSql()
dstTableSql field.private void copyExtentFields(FastCopyHelper.FastCopyContext fastCopyContext) throws PersistenceException
copyExtentFields(java.util.Map<java.lang.Integer, java.util.List<com.goldencode.p2j.persist.orm.Property[]>>, java.lang.String, long) with table specific parameters. This will
also try to create a database-level primary key mapping if it doesn't already exist.fastCopyContext - The context that has the required information.PersistenceExceptionprivate void createPkMapping(FastCopyHelper.FastCopyContext fastCopyContext) throws PersistenceException
createPkMapping(com.goldencode.p2j.persist.FastCopyHelper.FastCopyContext, java.lang.String, java.lang.String, boolean) with table specific parameters. This will
take care that a single pk mapping will be online at once.fastCopyContext - The context that has the required information.PersistenceExceptionprivate java.util.Map<java.lang.Long,java.lang.Long[]> getMapping(FastCopyHelper.FastCopyContext fastCopyContext) throws PersistenceException
getMapping(com.goldencode.p2j.persist.Persistence, java.lang.String) with table specific parameters. This will
cache eventually the mapping. Also, this may trigger a database-level pk mapping if it
doesn't already exist.fastCopyContext - The context that has the required information.PersistenceExceptionprivate java.lang.String assembleUidMapping(java.lang.String property)
uid value to properties in order to generate
unique names for the temporary and intermediary tables used in operations
or storing indexes,property - The property to which uid will be attached.