Package com.orchestranetworks.service
Class ImportSpecMode
- java.lang.Object
-
- com.orchestranetworks.service.ImportSpecMode
-
public final class ImportSpecMode extends Object
Defines the possible modes for an XML import.The complete specification of XML imports is available in XML Imports.
-
-
Field Summary
Fields Modifier and Type Field Description static ImportSpecModeINSERTInsert mode: only record creations are allowed.static ImportSpecModeREPLACEReplace (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 ImportSpecModeUPDATEUpdate mode: only modifications of existing records are allowed.static ImportSpecModeUPDATE_OR_INSERTUpdate or insert mode: both record creations and modifications of existing records are allowed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat()Returns a persistent identifier for this definition mode.StringgetLabel()Returns a human-readable label for this XML import mode.booleanisInsert()Returnstrueif this isINSERTmode.booleanisReplace()Returnstrueif this isREPLACEmode.booleanisUpdate()Returnstrueif this isUPDATEmode.booleanisUpdateOrInsert()Returnstrueif this isUPDATE_OR_INSERTmode.static ImportSpecModeparse(String aFlag)Returns the definition mode that corresponds to the string specified.StringtoString()
-
-
-
Field Detail
-
UPDATE
public static final ImportSpecMode 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
public static final ImportSpecMode 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
public static final ImportSpecMode 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
public static final ImportSpecMode 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 Detail
-
isUpdate
public boolean isUpdate()
Returnstrueif this isUPDATEmode.
-
isInsert
public boolean isInsert()
Returnstrueif this isINSERTmode.
-
isUpdateOrInsert
public boolean isUpdateOrInsert()
Returnstrueif this isUPDATE_OR_INSERTmode.
-
isReplace
public boolean isReplace()
Returnstrueif this isREPLACEmode.
-
format
public String format()
Returns a persistent identifier for this definition mode.The
ImportSpecModecan obtained by parsing the persistent identifier using the methodparse(String).- See Also:
parse(String)
-
parse
public static ImportSpecMode parse(String aFlag)
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:
format()
-
getLabel
public String getLabel()
Returns a human-readable label for this XML import mode.
-
-