Package com.orchestranetworks.service
Class ImportSpecMode
java.lang.Object
com.orchestranetworks.service.ImportSpecMode
Defines the possible modes for an XML import.
The complete specification of XML imports is available in XML Imports.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImportSpecMode
Insert mode: only record creations are allowed.static final ImportSpecMode
Replace (synchronization) mode: if a record with the same primary key exists in the target table, it is updated, otherwise, a new record is inserted; if a record is not present in the source, it is deleted.static final ImportSpecMode
Update mode: only modifications of existing records are allowed.static final ImportSpecMode
Update or insert mode: both record creations and modifications of existing records are allowed. -
Method Summary
Modifier and TypeMethodDescriptionformat()
Returns a persistent identifier for this definition mode.getLabel()
Returns a human-readable label for this XML import mode.boolean
isInsert()
Returnstrue
if this isINSERT
mode.boolean
Returnstrue
if this isREPLACE
mode.boolean
isUpdate()
Returnstrue
if this isUPDATE
mode.boolean
Returnstrue
if this isUPDATE_OR_INSERT
mode.static ImportSpecMode
Returns the definition mode that corresponds to the string specified.toString()
-
Field Details
-
UPDATE
Update mode: only modifications of existing records are allowed. If, in the target table, a record with the same primary key does not exist, an error is returned and the whole operation is cancelled. -
INSERT
Insert mode: only record creations are allowed. If a record already exists in the target table with the same primary key as in the source, an error is returned and the whole operation is cancelled. -
UPDATE_OR_INSERT
Update or insert mode: both record creations and modifications of existing records are allowed. If a record with the same primary key exists in the target table, it is updated, otherwise, a new record is inserted. -
REPLACE
Replace (synchronization) mode: if a record with the same primary key exists in the target table, it is updated, otherwise, a new record is inserted; if a record is not present in the source, it is deleted.
-
-
Method Details
-
isUpdate
public boolean isUpdate()Returnstrue
if this isUPDATE
mode. -
isInsert
public boolean isInsert()Returnstrue
if this isINSERT
mode. -
isUpdateOrInsert
public boolean isUpdateOrInsert()Returnstrue
if this isUPDATE_OR_INSERT
mode. -
isReplace
public boolean isReplace()Returnstrue
if this isREPLACE
mode. -
format
Returns a persistent identifier for this definition mode.The
ImportSpecMode
can obtained by parsing the persistent identifier using the methodparse(String)
.- See Also:
-
parse
Returns the definition mode that corresponds to the string specified.The specified string must have been generated by the method
format()
.- Throws:
IllegalArgumentException
- if string specified is an invalid persistent identifier.- See Also:
-
getLabel
Returns a human-readable label for this XML import mode. -
toString
-