Examples of connectionDictionary()


Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

    }

    Enumeration modelsEnum = _modelGroup.models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel model = (EOModel) modelsEnum.nextElement();
      if (model.connectionDictionary() == null) {
        model.setConnectionDictionary(defaultConnectionDictionary);
      }
    }

    if (_modelProcessor == null) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

    }

    Enumeration modelsEnum = _modelGroup.models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel model = (EOModel) modelsEnum.nextElement();
      if (model.connectionDictionary() == null) {
        model.setConnectionDictionary(defaultConnectionDictionary);
      }
    }

    if (_modelProcessor == null) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

    NSDictionary jdbcInfoDictionary = null;
    if (jdbcInfo != null && jdbcInfo.length() > 0 && jdbcInfo.charAt(0) == '^') {
      String modelName = jdbcInfo.substring(1, jdbcInfo.length());
      EOModel modelForCopy = model.modelGroup().modelNamed(modelName);
      if (modelForCopy != null && modelForCopy != model) {
        jdbcInfoDictionary = (NSDictionary) modelForCopy.connectionDictionary().objectForKey("jdbc2Info");
      }
      else {
        log.warn("Unable to find model named \"" + modelName + "\"");
        jdbcInfo = null;
      }
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

    String[] keysThatMatter = { "URL", "username" };
    Enumeration modelsEnum = model.modelGroup().models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel otherModel = (EOModel)modelsEnum.nextElement();
      if (otherModel != model) {
        NSDictionary otherConnectionDictionary = otherModel.connectionDictionary();
        if (otherConnectionDictionary != null && ObjectUtils.equals(newConnectionDictionary.objectForKey("adaptorName"), otherConnectionDictionary.objectForKey("adaptorName"))) {
          boolean valuesThatMatterMatch = true;
          for (int keyNum = 0; valuesThatMatterMatch && keyNum < keysThatMatter.length; keyNum ++) {
            String thisValue = (String)newConnectionDictionary.objectForKey(keysThatMatter[keyNum]);
            String otherValue = (String)otherConnectionDictionary.objectForKey(keysThatMatter[keyNum]);
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

    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()
        .append("ALTER TABLE ")
        .append(sqlStringForSchemaObjectName(entity.externalName()))
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

        EOEditingContext ec = ERXEC.newEditingContext();
        ec.lock();
        try {
            EOModel model = EOModelGroup.defaultGroup().modelNamed("BugTracker");
            EOEntity release = model.entityNamed("Release");
            if(model.connectionDictionary().toString().toLowerCase().indexOf(":mysql") >= 0) {
                release.setExternalName("`RELEASE`");
            } else if(model.connectionDictionary().toString().toLowerCase().indexOf(":derby") >= 0) {
                // AK: if we set the connection string to ;create=true, then subsequent model create scripts will
                // delete former entries, so we set this once here.
                String url = ""+ model.connectionDictionary().objectForKey("URL");
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

        try {
            EOModel model = EOModelGroup.defaultGroup().modelNamed("BugTracker");
            EOEntity release = model.entityNamed("Release");
            if(model.connectionDictionary().toString().toLowerCase().indexOf(":mysql") >= 0) {
                release.setExternalName("`RELEASE`");
            } else if(model.connectionDictionary().toString().toLowerCase().indexOf(":derby") >= 0) {
                // AK: if we set the connection string to ;create=true, then subsequent model create scripts will
                // delete former entries, so we set this once here.
                String url = ""+ model.connectionDictionary().objectForKey("URL");
                if(!url.contains(";create=true")) {
                    java.sql.Connection conn = null;
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

            if(model.connectionDictionary().toString().toLowerCase().indexOf(":mysql") >= 0) {
                release.setExternalName("`RELEASE`");
            } else if(model.connectionDictionary().toString().toLowerCase().indexOf(":derby") >= 0) {
                // AK: if we set the connection string to ;create=true, then subsequent model create scripts will
                // delete former entries, so we set this once here.
                String url = ""+ model.connectionDictionary().objectForKey("URL");
                if(!url.contains(";create=true")) {
                    java.sql.Connection conn = null;
                    try {
                        Class foundDriver = Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
                        conn = java.sql.DriverManager.getConnection(url +";create=true");
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

        }
        catch (ERXMigrationFailedException e) {
          throw e;
        }
        catch (EOGeneralAdaptorException t) {
            new ERXJDBCConnectionAnalyzer(model.connectionDictionary());
          throw new ERXMigrationFailedException("Failed to migrate model '" + model.name() + "'.", t);
        }
        catch (Throwable t) {
          throw new ERXMigrationFailedException("Failed to migrate model '" + model.name() + "'.", t);
        }       
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel.connectionDictionary()

      String sourceKeyList = sourceColumns.componentsJoinedByString(", ");
      String destinationKeyList = destinationColumns.componentsJoinedByString(", ");

      EOModel sourceModel = entity.model();
      EOModel destModel = relationship.destinationEntity().model();
      if (sourceModel != destModel && !sourceModel.connectionDictionary().equals(destModel.connectionDictionary())) {
        throw new IllegalArgumentException("prepareConstraintStatementForRelationship unable to create a constraint for " + relationship.name() + " because the source and destination entities reside in different databases");
      }
      else {
        setStatement("ALTER TABLE " + entity.externalName() + " ADD CONSTRAINT " + constraintName + " FOREIGN KEY (" + sourceKeyList + ") REFERENCES " + relationship.destinationEntity().externalName() + " (" + destinationKeyList + ") DEFERRABLE INITIALLY DEFERRED");
      }
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.