public class SynchroServiceUtils extends Object
Constructor and Description |
---|
SynchroServiceUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkSchemas(SynchroDatabaseMetadata sourceSchema,
SynchroDatabaseMetadata targetSchema,
boolean allowMissingOptionalColumn,
boolean allowAdditionalMandatoryColumnInSourceSchema,
SynchroResult result)
Check that the tow given shemas are compatible for a
synchronize operation (same tables with same columns).
|
protected static void |
checkSchemasAllowMissingOptionalColumn(SynchroDatabaseMetadata sourceSchema,
SynchroDatabaseMetadata targetSchema,
boolean allowAdditionalMandatoryColumnInSourceSchema,
SynchroResult result)
Check that the tow given shemas are compatible for a synchronize operation (same tables with same columns). *
This method allow missing columns (if define as nullable in the target schema)
If schemas are incompatible, then a
SynchroTechnicalException exception will be thrown. |
protected static void |
checkSchemasStrict(SynchroDatabaseMetadata sourceSchema,
SynchroDatabaseMetadata targetSchema)
Check that the tow given datasource shemas are compatible for a
synchronize operation (same tables with same columns).
|
public SynchroServiceUtils()
public static void checkSchemas(SynchroDatabaseMetadata sourceSchema, SynchroDatabaseMetadata targetSchema, boolean allowMissingOptionalColumn, boolean allowAdditionalMandatoryColumnInSourceSchema, SynchroResult result)
allowMissingOptionalColumn=true
then missing columns are allowed. Missing columns will be added
to the given result.
If allowAdditionalMandatoryColumnInSourceSchema=true
then additional mandatory columns in the source
schema are allowed. It could be set to
false for data synchronization, to avoid getting data from tables that could not be export later.
If schemas are incompatible, then a SynchroTechnicalException
exception will be thrown.
targetSchema
- schema 1 to checksourceSchema
- schema 2 to checkallowMissingOptionalColumn
- Is missing optional columns are allowed (in source or target schema) ? If true, missing column will be
ignore in synchronization.allowAdditionalMandatoryColumnInSourceSchema
- Is additional mandatory columns are allowed in source schema ? If true, source schema could have more
mandatory columns.result
- Synchro result. Use to store missing column is anyprotected static void checkSchemasAllowMissingOptionalColumn(SynchroDatabaseMetadata sourceSchema, SynchroDatabaseMetadata targetSchema, boolean allowAdditionalMandatoryColumnInSourceSchema, SynchroResult result)
SynchroTechnicalException
exception will be thrown.synchroContext
- Synchro contexttargetSchema
- schema 1 to checksourceSchema
- schema 2 to checkprotected static void checkSchemasStrict(SynchroDatabaseMetadata sourceSchema, SynchroDatabaseMetadata targetSchema)
SynchroTechnicalException
exception will be thrown.schema1
- schema 1 to checkschema2
- schema 2 to checkCopyright © 2012–2014 IFREMER. All rights reserved.