Package de.mid.innovator.srv2api.icw2db
Class DBForeignKeyHelper
java.lang.Object
de.mid.innovator.srv2api.icw2db.DBForeignKeyHelper
This is a utility class for DBForeignKey that provides static methods for creation or other purposes.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DBForeignKeycreate(SrvContext srvCtx, MMCreateTemplate ohTemplate, ELContainerAble ohContainer, ELElement ohRequirement) Create a new Foreign Key (of Table) with template and container with requirement.static DBForeignKeycreate(SrvContext srvCtx, MMStereotype ohStereotype, ELContainerAble ohContainer, ELElement ohRequirement) Create a new Foreign Key (of Table) with stereotype and container with requirement.static DBForeignKeycreateAndMaintain(SrvContext srvCtx, MMCreateTemplate ohTemplate, ELContainerAble ohContainer, ELElement ohRequirement) Create a new Foreign Key (of Table) with template and container with requirement.static DBForeignKeycreateAndMaintain(SrvContext srvCtx, MMStereotype ohStereotype, ELContainerAble ohContainer, ELElement ohRequirement) Create a new Foreign Key (of Table) with stereotype and container with requirement.static List<DBForeignKey> createByER(SrvContext srvCtx, ELContainerAble ohDBElement, MENamedElement ohERElement) This method creates (if possible) aDBForeignKeyfor the givenERForeignKey(ER element) in the givenDBTable(DB element).static DBTablemergeSiblingTables(SrvContext srvCtx, List<? extends ELElement> seq) Merges two or more sibling database tables of the given foreign keys.mergeToForeign(SrvContext srvCtx, List<? extends ELElement> seq) Merges theDBTablewhich contains theDBUniqueKeycorresponding to the selectedDBForeignKeyinto theDBTablewhich contains the foreign key.
This action creates aDBMergedTablein the modified table.mergeToUnique(SrvContext srvCtx, List<? extends DBForeignKey> seqForeign, List<Integer> seqCard) Merges theDBTableof the selectedDBForeignKeyinto theDBTablewhich contains the correspondingDBUniqueKey.
This action creates aDBMergedTablein the modified table.
-
Method Details
-
createByER
public static List<DBForeignKey> createByER(SrvContext srvCtx, ELContainerAble ohDBElement, MENamedElement ohERElement) throws InoNetException, SrvErrorException This method creates (if possible) aDBForeignKeyfor 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 aMEMappingDependencywith 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:
InoNetExceptionSrvErrorException
-
mergeSiblingTables
public static DBTable mergeSiblingTables(SrvContext srvCtx, 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 aDBMergedTablein the modified table.- Parameters:
srvCtx- The context of the related innovator server.seq- List of ELElement- Throws:
InoNetExceptionSrvErrorException
-
mergeToForeign
public static List<DBTable> mergeToForeign(SrvContext srvCtx, List<? extends ELElement> seq) throws InoNetException, SrvErrorException Merges theDBTablewhich contains theDBUniqueKeycorresponding to the selectedDBForeignKeyinto theDBTablewhich contains the foreign key.
This action creates aDBMergedTablein the modified table.- Parameters:
srvCtx- The context of the related innovator server.seq- List of ELElement- Throws:
InoNetExceptionSrvErrorException
-
mergeToUnique
public static List<DBTable> mergeToUnique(SrvContext srvCtx, List<? extends DBForeignKey> seqForeign, List<Integer> seqCard) throws InoNetException, SrvErrorException Merges theDBTableof the selectedDBForeignKeyinto theDBTablewhich contains the correspondingDBUniqueKey.
This action creates aDBMergedTablein the modified table.- Parameters:
srvCtx- The context of the related innovator server.seqForeign- foreign keysseqCard- cardinalities for merge- Throws:
InoNetExceptionSrvErrorException
-
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:
InoNetExceptionSrvErrorException
-
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:
InoNetExceptionSrvErrorException
-
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:
InoNetExceptionSrvErrorException
-
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:
InoNetExceptionSrvErrorException
-