Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EOEntity.model()


                  EOSQLExpression expression = this._expressionForString("create index " + tableName + " " + attribute.columnName());
                  if(expression != null) primaryKeyConstraintExpressions.addObject( expression );
                }
              }
              // Then deal with the other side
              if(entity.model() == relationship.destinationEntity().model()) {
                for (Enumeration attributeEnumerator = relationship.destinationAttributes().objectEnumerator(); attributeEnumerator.hasMoreElements(); ) {
                  EOAttribute attribute = (EOAttribute)attributeEnumerator.nextElement();
                  String destinationTableName = relationship.destinationEntity().externalName();
                  if( (destinationTableName != null) && ( ! "".equals(destinationTableName) ) ) {
                    if( (! this.isSinglePrimaryKeyAttribute(attribute)) && (columnNameDictionary.objectForKey(destinationTableName + "." + attribute.columnName()) != null) ) {
View Full Code Here


          if (priKeyAttribute.adaptorValueType() != EOAttribute.AdaptorNumberType) {
            continue;
          }

          String unique = null;
          if (eoentity.model() != null) {
            unique = System.getProperty("com.frontbase.unique." + eoentity.model().name() + "." + eoentity.name());
            if (unique == null) {
              unique = System.getProperty("com.frontbase.unique." + eoentity.model().name());
            }
          }
View Full Code Here

            continue;
          }

          String unique = null;
          if (eoentity.model() != null) {
            unique = System.getProperty("com.frontbase.unique." + eoentity.model().name() + "." + eoentity.name());
            if (unique == null) {
              unique = System.getProperty("com.frontbase.unique." + eoentity.model().name());
            }
          }
          if (unique == null) {
View Full Code Here

          String unique = null;
          if (eoentity.model() != null) {
            unique = System.getProperty("com.frontbase.unique." + eoentity.model().name() + "." + eoentity.name());
            if (unique == null) {
              unique = System.getProperty("com.frontbase.unique." + eoentity.model().name());
            }
          }
          if (unique == null) {
            unique = System.getProperty("com.frontbase.unique");
          }
View Full Code Here

     * @return EOModelGroup containing the models that contain the entities in entityGroups
     */
    public static EOModelGroup modelGroupForEntityGroups(NSArray entityGroups) {
        NSArray anEntityGroup = (NSArray) entityGroups.lastObject();
        EOEntity anEntity = (EOEntity) anEntityGroup.lastObject();
        return anEntity.model().modelGroup();
    }


    /**
     * Comparator to sort EOEntity instances based on an ERXEntityOrder ordering.
View Full Code Here

    // quotes the identifier in the array
   
    String sourceKeyList = quoteArrayContents(sourceColumns).componentsJoinedByString(", ");
    String destinationKeyList = quoteArrayContents(destinationColumns).componentsJoinedByString(", ");
   
    EOModel sourceModel = entity.model();
    EOModel destModel = relationship.destinationEntity().model();
    if (sourceModel != destModel && !sourceModel.connectionDictionary().equals(destModel.connectionDictionary())) {
      throw new IllegalArgumentException(new StringBuilder().append("prepareConstraintStatementForRelationship unable to create a constraint for ").append(relationship.name()).append(" because the source and destination entities reside in different databases").toString());
    }
    setStatement(new StringBuilder()
View Full Code Here

        return result;
    }

    protected boolean _shouldGenerateForeignKeyConstraints(EORelationship rel) {
        EOEntity destinationEntity = rel.destinationEntity();
        return !rel.isFlattened() && destinationEntity.externalName() != null && rel.entity().model() == destinationEntity.model();
    }

    /**
     * <code>DB2Expression</code> factory method.
     *
 
View Full Code Here

  public static NSArray snapshotArrayForRelationshipInObject(EOEnterpriseObject object, final String relationshipName) {
      final EOEditingContext ec = object.editingContext();
      EOEntity entity = EOUtilities.entityForObject(ec, object);

        final EOGlobalID gid = ec.globalIDForObject(object);
        String modelName = entity.model().name();
        final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

        NSArray toManySnapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSArray>() {
                    public NSArray execute(EODatabaseContext databaseContext) throws Exception {
View Full Code Here

    public static NSDictionary snapshotForObject(EOEnterpriseObject object) {
        final EOEditingContext ec = object.editingContext();
        EOEntity entity = EOUtilities.entityForObject(ec, object);

        final EOGlobalID gid = ec.globalIDForObject(object);
        String modelName = entity.model().name();
        final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

        NSDictionary snapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSDictionary>() {
                    public NSDictionary execute(EODatabaseContext databaseContext) throws Exception {
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.