コード例 #1
0
  protected void initialize(MWClassAttribute attribute, String name) {
    super.initialize(attribute, name);

    // TODO wow this is not pretty! and it's copied in other collection mappings
    if (attribute.isValueHolder()) {
      if (attribute.getValueType().isAssignableToMap()) {
        this.containerPolicy = new MWMapContainerPolicy(this);
      } else if (attribute.getValueType().isAssignableToList()) {
        this.containerPolicy = new MWListContainerPolicy(this);
      } else if (attribute.getValueType().isAssignableToSet()) {
        this.containerPolicy = new MWSetContainerPolicy(this);
      } else if (attribute.getValueType().isAssignableToCollection()) {
        this.containerPolicy = new MWCollectionContainerPolicy(this);
      } else { // This is the default in the runtime
        this.containerPolicy = new MWListContainerPolicy(this);
      }
      setUseValueHolderIndirection();
    } else {
      if (attribute.isAssignableToMap()) {
        this.containerPolicy = new MWMapContainerPolicy(this);
      } else if (attribute.isAssignableToList()) {
        this.containerPolicy = new MWListContainerPolicy(this);
      } else if (attribute.isAssignableToSet()) {
        this.containerPolicy = new MWSetContainerPolicy(this);
      } else if (attribute.isAssignableToCollection()) {
        this.containerPolicy = new MWCollectionContainerPolicy(this);
      } else { // This is the default in the runtime
        this.containerPolicy = new MWListContainerPolicy(this);
      }
      setUseTransparentIndirection();
    }
  }
コード例 #2
0
  protected void initializeFromMWIndirectableContainerMapping(
      MWIndirectableContainerMapping oldMapping) {
    super.initializeFromMWIndirectableContainerMapping(oldMapping);

    if (oldMapping.usesTransparentIndirection()) {
      this.setUseTransparentIndirection();
    }
  }
コード例 #3
0
  protected void addProblemsTo(List newProblems) {
    super.addProblemsTo(newProblems);

    this.checkFieldPairs(newProblems);

    this.checkGroupingElement(newProblems);
    this.checkGroupingElementForeignKeys(newProblems);

    this.checkSelectionInteraction(newProblems);
    this.checkDeleteAllInteraction(newProblems);

    this.addUsesTransparentIndirectionWhileMaintainsBiDirectionalRelationship(newProblems);
  }
コード例 #4
0
 protected void initialize(Node parent) {
   super.initialize(parent);
   this.foreignKeyLocation = KEYS_ON_TARGET;
   this.foreignKeyGroupingElement = new MWXmlField(this);
   this.deleteAllInteraction = new MWEisInteraction(this);
 }
コード例 #5
0
 /** @see MWXmlNode#schemaChanged(SchemaChange) */
 public void schemaChanged(SchemaChange change) {
   super.schemaChanged(change);
   this.foreignKeyGroupingElement.schemaChanged(change);
 }
コード例 #6
0
 /** @see MWXmlNode#resolveXpaths */
 public void resolveXpaths() {
   super.resolveXpaths();
   this.foreignKeyGroupingElement.resolveXpaths();
 }
コード例 #7
0
 public void initializeFromMWCompositeCollectionMapping(MWCompositeCollectionMapping oldMapping) {
   super.initializeFromMWCompositeCollectionMapping(oldMapping);
   // getContainerPolicy().initializeFrom(oldMapping.getContainerPolicy());
 }
コード例 #8
0
 protected void addChildrenTo(List children) {
   super.addChildrenTo(children);
   children.add(this.foreignKeyGroupingElement);
   children.add(this.containerPolicy);
   children.add(this.deleteAllInteraction);
 }