Package de.mid.innovator.srv2api.icw2db
Class DBForeignKeyHelper
- java.lang.Object
-
- de.mid.innovator.srv2api.icw2db.DBForeignKeyHelper
-
public abstract class DBForeignKeyHelper extends java.lang.Object
This is a utility class for DBForeignKey that provides static methods for creation or other purposes.- See Also:
DBForeignKey
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DBForeignKey
create(SrvContext srvCtx, MMCreateTemplate ohTemplate, ELContainerAble ohContainer, ELElement ohRequirement)
Create a new Foreign Key (of Table) with template and container with requirement.static DBForeignKey
create(SrvContext srvCtx, MMStereotype ohStereotype, ELContainerAble ohContainer, ELElement ohRequirement)
Create a new Foreign Key (of Table) with stereotype and container with requirement.static DBForeignKey
createAndMaintain(SrvContext srvCtx, MMCreateTemplate ohTemplate, ELContainerAble ohContainer, ELElement ohRequirement)
Create a new Foreign Key (of Table) with template and container with requirement.static DBForeignKey
createAndMaintain(SrvContext srvCtx, MMStereotype ohStereotype, ELContainerAble ohContainer, ELElement ohRequirement)
Create a new Foreign Key (of Table) with stereotype and container with requirement.static java.util.List<DBForeignKey>
createByER(SrvContext srvCtx, ELContainerAble ohDBElement, MENamedElement ohERElement)
This method creates (if possible) aDBForeignKey
for the givenERForeignKey
(ER element) in the givenDBTable
(DB element).static DBTable
mergeSiblingTables(SrvContext srvCtx, java.util.List<? extends ELElement> seq)
Merges two or more sibling database tables of the given foreign keys.static java.util.List<DBTable>
mergeToForeign(SrvContext srvCtx, java.util.List<? extends ELElement> seq)
Merges theDBTable
which contains theDBUniqueKey
corresponding to the selectedDBForeignKey
into theDBTable
which contains the foreign key.
This action creates aDBMergedTable
in the modified table.static java.util.List<DBTable>
mergeToUnique(SrvContext srvCtx, java.util.List<? extends DBForeignKey> seqForeign, java.util.List<java.lang.Integer> seqCard)
Merges theDBTable
of the selectedDBForeignKey
into theDBTable
which contains the correspondingDBUniqueKey
.
This action creates aDBMergedTable
in the modified table.
-
-
-
Method Detail
-
createByER
public static java.util.List<DBForeignKey> createByER(SrvContext srvCtx, ELContainerAble ohDBElement, MENamedElement ohERElement) throws InoNetException, SrvErrorException
This method creates (if possible) aDBForeignKey
for the givenERForeignKey
(ER element) in the givenDBTable
(DB element). It could be impossible to create the foreign key, if the referenced unique key does not exist in the DB model.
This standard mapping creates aMEMappingDependency
with the ER key as requirement element and with the newly created DB key as implementation element. The mapping dependency is marked as 'maintaining' for further automatic mapping maintenance.- Parameters:
srvCtx
- The context of the related innovator server.ohDBElement
- Target DB Element for evaluating the owner for the new elementohERElement
- Requirement element of the ER Model- Throws:
InoNetException
SrvErrorException
-
mergeSiblingTables
public static DBTable mergeSiblingTables(SrvContext srvCtx, java.util.List<? extends ELElement> seq) throws InoNetException, SrvErrorException
Merges two or more sibling database tables of the given foreign keys. The foreign keys must be identifying and maximum 1, and must reference the same primary key.
This action creates aDBMergedTable
in the modified table.- Parameters:
srvCtx
- The context of the related innovator server.seq
- List of ELElement- Throws:
InoNetException
SrvErrorException
-
mergeToForeign
public static java.util.List<DBTable> mergeToForeign(SrvContext srvCtx, java.util.List<? extends ELElement> seq) throws InoNetException, SrvErrorException
Merges theDBTable
which contains theDBUniqueKey
corresponding to the selectedDBForeignKey
into theDBTable
which contains the foreign key.
This action creates aDBMergedTable
in the modified table.- Parameters:
srvCtx
- The context of the related innovator server.seq
- List of ELElement- Throws:
InoNetException
SrvErrorException
-
mergeToUnique
public static java.util.List<DBTable> mergeToUnique(SrvContext srvCtx, java.util.List<? extends DBForeignKey> seqForeign, java.util.List<java.lang.Integer> seqCard) throws InoNetException, SrvErrorException
Merges theDBTable
of the selectedDBForeignKey
into theDBTable
which contains the correspondingDBUniqueKey
.
This action creates aDBMergedTable
in the modified table.- Parameters:
srvCtx
- The context of the related innovator server.seqForeign
- foreign keysseqCard
- cardinalities for merge- Throws:
InoNetException
SrvErrorException
-
create
public static DBForeignKey create(SrvContext srvCtx, MMStereotype ohStereotype, ELContainerAble ohContainer, ELElement ohRequirement) throws InoNetException, SrvErrorException
Create a new Foreign Key (of Table) with stereotype and container with requirement.- Parameters:
srvCtx
- The context of the related innovator server.ohStereotype
- Stereotype for the new elementohContainer
- Container for the new elementohRequirement
- Additional required element- Throws:
InoNetException
SrvErrorException
-
create
public static DBForeignKey create(SrvContext srvCtx, MMCreateTemplate ohTemplate, ELContainerAble ohContainer, ELElement ohRequirement) throws InoNetException, SrvErrorException
Create a new Foreign Key (of Table) with template and container with requirement.- Parameters:
srvCtx
- The context of the related innovator server.ohTemplate
- Template for the new elementohContainer
- Container for the new elementohRequirement
- Additional required element- Throws:
InoNetException
SrvErrorException
-
createAndMaintain
public static DBForeignKey createAndMaintain(SrvContext srvCtx, MMStereotype ohStereotype, ELContainerAble ohContainer, ELElement ohRequirement) throws InoNetException, SrvErrorException
Create a new Foreign Key (of Table) with stereotype and container with requirement. The created element is maintained.- Parameters:
srvCtx
- The context of the related innovator server.ohStereotype
- Stereotype for the new elementohContainer
- Container for the new elementohRequirement
- Additional required element- Throws:
InoNetException
SrvErrorException
-
createAndMaintain
public static DBForeignKey createAndMaintain(SrvContext srvCtx, MMCreateTemplate ohTemplate, ELContainerAble ohContainer, ELElement ohRequirement) throws InoNetException, SrvErrorException
Create a new Foreign Key (of Table) with template and container with requirement. The created element is maintained.- Parameters:
srvCtx
- The context of the related innovator server.ohTemplate
- Template for the new elementohContainer
- Container for the new elementohRequirement
- Additional required element- Throws:
InoNetException
SrvErrorException
-
-