Class 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 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()
        Returns true if this is UPDATE mode.
      • isInsert

        public boolean isInsert()
        Returns true if this is INSERT mode.
      • isUpdateOrInsert

        public boolean isUpdateOrInsert()
        Returns true if this is UPDATE_OR_INSERT mode.
      • isReplace

        public boolean isReplace()
        Returns true if this is REPLACE mode.
      • format

        public String format()
        Returns a persistent identifier for this definition mode.

        The ImportSpecMode can obtained by parsing the persistent identifier using the method parse(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.