Examples of EOJoin


Examples of com.webobjects.eoaccess.EOJoin

    EORelationship relationship = new EORelationship();
    relationship.setName(sourceAttributes.objectAtIndex(0).name() + "_" + destinationAttributes.objectAtIndex(0).name());
    relationship.setEntity(sourceEntity);
   
    for (int attributeNum = 0; attributeNum < sourceAttributes.count(); attributeNum ++) {
      EOJoin join = new EOJoin(sourceAttributes.objectAtIndex(attributeNum), destinationAttributes.objectAtIndex(attributeNum));
      relationship.addJoin(join);
    }
   
    return relationship;
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOJoin

      NSArray joins = r.joins();
      int joinsCount = joins.count();
      NSMutableArray joinStrings = new NSMutableArray(joinsCount);
      for (int i = 0; i < joinsCount; i++) {
        EOJoin currentJoin = (EOJoin) joins.objectAtIndex(i);
        String left = leftAlias + "." + sqlStringForSchemaObjectName(currentJoin.sourceAttribute().columnName());
        String right = rightAlias + "." + sqlStringForSchemaObjectName(currentJoin.destinationAttribute().columnName());
        joinStrings.addObject(left + " = " + right);
      }
      jc.joinCondition = " ON " + joinStrings.componentsJoinedByString(" AND ");
      if (!_alreadyJoined.containsObject(jc)) {
        _alreadyJoined.insertObjectAtIndex(jc, 0);
View Full Code Here

Examples of com.webobjects.eoaccess.EOJoin

      // Compute joinCondition
      NSArray<EOJoin> joins = r.joins();
      int joinsCount = joins.count();
      NSMutableArray<String> joinStrings = new NSMutableArray<String>(joinsCount);
      for (int i = 0; i < joinsCount; i++) {
        EOJoin currentJoin = joins.objectAtIndex(i);
        String left;
        String right;
        if (CONFIG.ENABLE_IDENTIFIER_QUOTING) {
          left = leftAlias + "." + sqlStringForSchemaObjectName(currentJoin.sourceAttribute().columnName());
          right = rightAlias + "." + sqlStringForSchemaObjectName(currentJoin.destinationAttribute().columnName());
        } else {
          left = leftAlias + "." + currentJoin.sourceAttribute().columnName();
          right = rightAlias + "." + currentJoin.destinationAttribute().columnName();
        }
        joinStrings.addObject(left + " = " + right);
      }
      String joinCondition = " ON " + joinStrings.componentsJoinedByString(" AND ");
     
View Full Code Here

Examples of com.webobjects.eoaccess.EOJoin

        jc.table2 = rightTable + " " + rightAlias;
        NSArray<EOJoin> joins = r.joins();
        int joinsCount = joins.count();
        NSMutableArray<String> joinStrings = new NSMutableArray<String>(joinsCount);
        for( int i = 0; i < joinsCount; i++ ) {
            EOJoin currentJoin = joins.objectAtIndex(i);
            String left;
            String right;
            if(enableIdentifierQuoting()) {
                left = leftAlias +"."+ sqlStringForSchemaObjectName(currentJoin.sourceAttribute().columnName());
                right =  rightAlias +"."+ sqlStringForSchemaObjectName(currentJoin.destinationAttribute().columnName());
            } else {
                left = leftAlias +"."+currentJoin.sourceAttribute().columnName();
                right = rightAlias +"."+currentJoin.destinationAttribute().columnName();
            }
            joinStrings.addObject( left + " = " + right);
        }
        jc.joinCondition = " ON " + joinStrings.componentsJoinedByString( " AND " );
        if( !_alreadyJoined.containsObject( jc ) ) {
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOJoin

  }

  @Override
  public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    try {
      EOJoin newJoin = null;
      if (_createFK) {
        _foreignKey = _sourceEntity.createForeignKeyTo(_destinationEntity, _fkName, _fkColumnName, false);
        newJoin = new EOJoin();
        newJoin.setSourceAttribute(_foreignKey);
        newJoin.setDestinationAttribute(_destinationEntity.getSinglePrimaryKeyAttribute());
      }
      if (_createInverseFK) {
        _inverseForeignKey = _destinationEntity.createForeignKeyTo(_sourceEntity, _inverseFKName, _inverseFKColumnName, false);
        newJoin = new EOJoin();
        newJoin.setSourceAttribute(_sourceEntity.getSinglePrimaryKeyAttribute());
        newJoin.setDestinationAttribute(_inverseForeignKey);
      }

      if (newJoin != null) {
        _relationship.removeAllJoins();
        _relationship.addJoin(newJoin);
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOJoin

      EOEntity destination = relationship.getDestination();
      if (destination != null) {
        value = destination.getName();
      }
    } else if (EOJoin.SOURCE_ATTRIBUTE.equals(_property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        value = firstJoin.getSourceAttribute().getName();
      }
    } else if (EOJoin.DESTINATION_ATTRIBUTE.equals(_property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        value = firstJoin.getDestinationAttribute().getName();
      }
    } else {
      value = super.getComparisonValue(_obj, _property);
    }
    return value;
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOJoin

      EOEntity destination = relationship.getDestination();
      if (destination != null) {
        text = destination.getName();
      }
    } else if (EOJoin.SOURCE_ATTRIBUTE.equals(property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        EOAttribute sourceAttribute = firstJoin.getSourceAttribute();
        if (sourceAttribute != null) {
          text = sourceAttribute.getName();
        }
      }
    } else if (EOJoin.DESTINATION_ATTRIBUTE.equals(property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        EOAttribute destinationAttribute = firstJoin.getDestinationAttribute();
        if (destinationAttribute != null) {
          text = destinationAttribute.getName();
        }
      }
    } else {
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOJoin

      TableUtils.packTableColumns(myJoinsTableViewer);
    }
  }

  protected void addSelectedJoin() {
    EOJoin newJoin = new EOJoin();
    myRelationship.addJoin(newJoin);
    myJoinsTableViewer.setSelection(new StructuredSelection(newJoin));
  }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOJoin

    Object[] selectedJoins = ((IStructuredSelection) myJoinsTableViewer.getSelection()).toArray();
    if (selectedJoins.length > 0) {
      boolean confirmed = MessageDialog.openConfirm(getShell(), Messages.getString("EORelationshipBasicEditorSection.removeJoinsTitle"), Messages.getString("EORelationshipBasicEditorSection.removeJoinsMessage"));
      if (confirmed) {
        for (int joinNum = 0; joinNum < selectedJoins.length; joinNum++) {
          EOJoin join = (EOJoin) selectedJoins[joinNum];
          myRelationship.removeJoin(join);
        }
      }
    }
  }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOJoin

    boolean canModify = true;
    return canModify;
  }

  public Object getValue(Object _element, String _property) {
    EOJoin join = (EOJoin) _element;
    Object value = null;
    if (EOJoin.DESTINATION_ATTRIBUTE_NAME.equals(_property)) {
      String attributeName = join.getDestinationAttributeName();
      if (attributeName != null) {
        value = new Integer(Arrays.asList(join.getRelationship().getDestination().getAttributeNames()).indexOf(attributeName));
      }
    } else if (EOJoin.SOURCE_ATTRIBUTE_NAME.equals(_property)) {
      String attributeName = join.getSourceAttributeName();
      if (attributeName != null) {
        value = new Integer(Arrays.asList(join.getRelationship().getEntity().getAttributeNames()).indexOf(attributeName));
      }
    } else {
      value = super.getValue(_element, _property);
    }
    return value;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.