Examples of EOAdaptor


Examples of com.webobjects.eoaccess.EOAdaptor

        }
        File dumpFile = new File(dumpDir + File.separator + eomodel.name() + ".sql");
        if (dumpFile.exists() && ! dumpFile.canWrite()) {
          throw NSForwardException._runtimeExceptionForThrowable(new IllegalArgumentException(SQLDUMP_FILE_NOT_WRITEABLE));
        }
        EOAdaptor adaptor = EOAdaptor.adaptorWithModel(eomodel);
        if (adaptor instanceof JDBCAdaptor) {
          JDBCAdaptor jdbc = (JDBCAdaptor) adaptor;
          ERXSQLHelper helper = ERXSQLHelper.newSQLHelper(jdbc);
          String sql = helper.createSchemaSQLForEntitiesInModelAndOptions(eomodel.entities(), eomodel, helper.defaultOptionDictionary(true, true));
          ERXFileUtilities.writeInputStreamToFile(new ByteArrayInputStream(sql.getBytes()), dumpFile);
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

        }

        public WOComponent update() {
            sql = "";
            try {
                EOAdaptor adaptor = EOAdaptor.adaptorWithModel(model);
                EOSchemaGeneration synchronizationFactory = adaptor.synchronizationFactory();
                NSArray array = synchronizationFactory.createTableStatementsForEntityGroup(new NSArray(selectedEntity));
                sql =  ((NSArray)array.valueForKeyPath("statement")).componentsJoinedByString(";\n");
            } catch(Exception ex) {
                sql = "" + ex;
            }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

        if (os instanceof EOObjectStoreCoordinator) {
            EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator)os;
            EOCooperatingObjectStore cos = osc.objectStoreForObject(eo);
            if (cos instanceof EODatabaseContext) {
                EODatabaseContext dbctx = (EODatabaseContext)cos;
                EOAdaptor adaptor = dbctx.database().adaptor();
                return ERXJDBCConnectionBroker.connectionBrokerForAdaptor(adaptor);
            }
        }
        throw new IllegalStateException("No connection broker found for EC");
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

   */
  public EOSQLExpression sqlExpressionForFetchSpecification(EOEditingContext ec, EOFetchSpecification spec, long start, long end, NSArray<EOAttribute> attributes) {
    EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, spec.entityName());
    EOModel model = entity.model();
    EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, model.name());
    EOAdaptor adaptor = dbc.adaptorContext().adaptor();
    EOSQLExpressionFactory sqlFactory = adaptor.expressionFactory();
    spec = (EOFetchSpecification) spec.clone();

    EOQualifier qualifier = spec.qualifier();
    if (qualifier != null) {
      qualifier = EOQualifierSQLGeneration.Support._schemaBasedQualifierWithRootEntity(qualifier, entity);
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

  public static ERXSQLHelper newSQLHelper(EOEditingContext ec, EOModel model) {
    return ERXSQLHelper.newSQLHelper(EODatabaseContext.registeredDatabaseContextForModel(model, ec));
  }

  public static ERXSQLHelper newSQLHelper(EODatabaseContext databaseContext) {
    EOAdaptor adaptor = databaseContext.database().adaptor();
    return ERXSQLHelper.newSQLHelper(adaptor);
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

    EOAdaptor adaptor = databaseContext.database().adaptor();
    return ERXSQLHelper.newSQLHelper(adaptor);
  }

  public static ERXSQLHelper newSQLHelper(EODatabaseChannel databaseChannel) {
    EOAdaptor adaptor = databaseChannel.adaptorChannel().adaptorContext().adaptor();
    return ERXSQLHelper.newSQLHelper(adaptor);
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

    // MS: Hack to support non JDBC adaptor migrations
    return new NoSQLHelper();
  }

  public static ERXSQLHelper newSQLHelper(EOAdaptorChannel adaptorChannel) {
    EOAdaptor adaptor = adaptorChannel.adaptorContext().adaptor();
    return ERXSQLHelper.newSQLHelper(adaptor);
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

  public static ERXSQLHelper newSQLHelper(EOEntity entity) {
    return ERXSQLHelper.newSQLHelper(entity.model());
  }

  public static ERXSQLHelper newSQLHelper(EOModel model) {
    EOAdaptor adaptor = EOAdaptor.adaptorWithModel(model);
    return ERXSQLHelper.newSQLHelper(adaptor);
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

   *            the entity to add the attribute to
   * @return an EOAttribute with all of its fields filled in
   */
  @SuppressWarnings("unchecked")
  public EOAttribute _newAttribute(EOEntity entity) {
    EOAdaptor eoAdaptor = _table.database().adaptor();
    // MS: Hack to make Memory adaptor migrations "work"
    if (!(eoAdaptor instanceof JDBCAdaptor)) {
      EOAttribute nonJdbcAttribute = new EOAttribute();
      nonJdbcAttribute.setName(_name);
      nonJdbcAttribute.setColumnName(_name);
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptor

   * @param userName the new username
   * @param password the new password
   * @return a new adaptor channel
   */
  public static EOAdaptorChannel adaptorChannelWithUserAndPassword(String adaptorName, NSDictionary originalConnectionDictionary, String userName, String password) {
    EOAdaptor adaptor = EOAdaptor.adaptorWithName(adaptorName);
    NSMutableDictionary newConnectionDictionary = originalConnectionDictionary.mutableClone();
    if (userName == null) {
      newConnectionDictionary.removeObjectForKey(JDBCAdaptor.UsernameKey);
    }
    else {
      newConnectionDictionary.setObjectForKey(userName, JDBCAdaptor.UsernameKey);
    }
    if (password == null) {
      newConnectionDictionary.removeObjectForKey(JDBCAdaptor.PasswordKey);
    }
    else {
      newConnectionDictionary.setObjectForKey(password, JDBCAdaptor.PasswordKey);
    }
    adaptor.setConnectionDictionary(newConnectionDictionary);
    return adaptor.createAdaptorContext().createAdaptorChannel();
  }
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.