public class OdiSubModel extends AbstractOdiSubModel implements IModel
 A sub model may be contained by a OdiModel or another sub model. A sub model may also contain any number of other sub models.
 
 The datastores of a model can be inserted directly by using AbstractOdiSubModel.addDataStore(OdiDataStore), or by automatic distribution.
 The base class AbstractOdiSubModel handles adding, removing datastores. This class handles the automatic 
 distribution configuration for the datastores.
 
For automatic distribution, Use this class to define a distribution rule of the datastores in your sub models. Datastores, depending on the datastores distribution rule for each sub model, are compared to the automatic distribution mask. If they match this pattern, then they are moved into this sub model.
There are two methods to classify:
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
OdiSubModel.DistributionRule
Defines data store distribution rule that apply to an  
OdiSubModel. | 
CODE_MAX_LENGTH, NAME_MAX_LENGTH| Constructor and Description | 
|---|
OdiSubModel(OdiModel pParentModel,
           java.lang.String pName,
           java.lang.String pCode)
Creates a sub model with a parent model, a name and a code. 
 | 
OdiSubModel(OdiSubModel pParentSubModel,
           java.lang.String pName,
           java.lang.String pCode)
Creates a sub model with a parent sub model, a name and a code. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addSubModel(OdiSubModel pSubModel)
Add the given sub model to the collection of sub models of this  
OdiSubModel instance. | 
java.lang.String | 
getDistributionMask()
Get the distribution mask for this  
OdiSubModel instance. | 
java.lang.String | 
getDistributionOrder()
Get the distribution order for this  
OdiSubModel instance. | 
OdiSubModel.DistributionRule | 
getDistributionRule()
Get the distribution rule for this  
OdiSubModel instance. | 
java.util.Collection | 
getSubModels()
Obtains the unmodifiable collection of sub models of this  
OdiSubModel instance. | 
void | 
removeSubModel(OdiSubModel pSubModel)
Remove the given sub model from the collection of sub models of this  
OdiSubModel instance. | 
void | 
setDistributionMask(java.lang.String pDistributionMask)
Set the distribution mask for this  
OdiSubModel instance. | 
void | 
setDistributionOrder(java.lang.String pDistributionOrder)
Defines the distribution order of this  
OdiSubModel instance. | 
void | 
setDistributionRule(OdiSubModel.DistributionRule pDistributionRule)
Set the distribution rule for this  
OdiSubModel instance. | 
void | 
setName(java.lang.String pName)
Set the name of this  
OdiSubModel instance. | 
addDataStore, getCode, getDataStores, getInternalId, getModel, getName, getParentSubModel, getSubModelId, removeDataStoregetFirstDate, getFirstUser, getInternalVersion, getLastDate, getLastUser, isInstanceLevelSecurityNeeded, isNew, preCommit, toStringequals, getBigNumericId, getGlobalId, getNumericId, getParent, hashCodegetDataStoresgetNamegetBigNumericId, getGlobalId, getNumericIdgetFirstDate, getFirstUser, getLastDate, getLastUser, isInstanceLevelSecurityNeededgetGlobalId, getParentpublic OdiSubModel(OdiModel pParentModel, java.lang.String pName, java.lang.String pCode)
pParentModel - parent modelpName - sub model namepCode - unique code for sub modelDomainRuntimeException - if parent model is null ; if the name is null, empty or longer than NAME_MAX_LENGTH;
 if the code is null, empty, longer than CODE_MAX_LENGTH, or contains whitespaces or is not uppercaseOdiModelpublic OdiSubModel(OdiSubModel pParentSubModel, java.lang.String pName, java.lang.String pCode)
pParentSubModel - parent sub modelpName - sub model namepCode - unique sub model codeDomainRuntimeException - if the parent sub model is null ; if the name is null, empty or longer than NAME_MAX_LENGTH ;
 if the code is null, empty, longer than CODE_MAX_LENGTH, contains whitespaces or is not uppercasepublic java.util.Collection getSubModels()
OdiSubModel instance.
 Use removeSubModel(OdiSubModel) and addSubModel(OdiSubModel) to respectively add and remove a sub model.
getSubModels in interface IModeladdSubModel(OdiSubModel), 
removeSubModel(OdiSubModel)public void addSubModel(OdiSubModel pSubModel)
OdiSubModel instance.
 This will also set the ParentSubModel of the given sub model to this sub model. If the given sub model was already associated to an other sub model, it will be removed from the other sub model.
pSubModel - sub model to be addedDomainRuntimeException - if pSubModel is null or if you try to move the pSubModel to an other OdiModel or if you try to create cycles in hierarchypublic void removeSubModel(OdiSubModel pSubModel)
OdiSubModel instance. 
 This will also reset the OdiSubModel of the given sub model to null.
Note: IOdiEntityManager.remove(pSubModel) must also be called in order to remove the sub model from the repository
pSubModel - sub model to be removedDomainRuntimeException - if pSubModel is null or does not belong to this OdiSubModelpublic java.lang.String getDistributionMask()
OdiSubModel instance.
 
 The distribution mask determines the pattern to which the datastores names must adhere to be classified in this OdiSubModel instance.
setDistributionMask(String)public void setDistributionMask(java.lang.String pDistributionMask)
OdiSubModel instance.
 
 The distribution mask determines the pattern to which the datastores names must adhere to be classified in this OdiSubModel instance.
pDistributionMask - the data stores distribution maskgetDistributionMask()public OdiSubModel.DistributionRule getDistributionRule()
OdiSubModel instance.
 The distribution rule determines which datastores will be considered and compared to the automatic assignment mask.
setDistributionRule(DistributionRule)public void setDistributionRule(OdiSubModel.DistributionRule pDistributionRule)
OdiSubModel instance.
 The distribution rule determines which datastores will be considered and compared to the automatic assignment mask.
By default distribution rule is set to OdiSubModel.DistributionRule.NO_DISTRIBUTION.
pDistributionRule - the distribution ruleDomainRuntimeException - if given rule is nullgetDistributionRule()public java.lang.String getDistributionOrder()
OdiSubModel instance.
  The distribution order determines the order in which the mask is applied at the end of a reverse-engineering process. Consequently, a rule with a high priority order on all datastores will have precedence. A rule with a high order on non classified datastores will apply only on datastores ignored by the other rules' patterns. At the end of the reverse-engineering process, new datastores are considered as non classified. Those already classified as a sub model stay attached to their sub model.
OdiSubModel instancesetDistributionOrder(String)public void setDistributionOrder(java.lang.String pDistributionOrder)
OdiSubModel instance. 
 The distribution order determines the order in which the mask is applied at the end of a reverse-engineering process. Consequently, a rule with a high priority order on all datastores will have precedence. A rule with a high order on non classified datastores will apply only on datastores ignored by the other rules' patterns. At the end of the reverse-engineering process, new datastores are considered as non classified. Those already classified as a sub model stay attached to their sub model.
By default distribution order is set to null.
pDistributionOrder - the distribution ordergetDistributionOrder()public void setName(java.lang.String pName)
OdiSubModel instance.pName - sub model nameDomainRuntimeException - if the name is null, empty, contains whitespaces or is longer than NAME_MAX_LENGTH