Examples of adaptorContext()


Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

    }

    callModelProcessorMethodIfExists("processModel", new Object[] { _model, _entities, flags });

    EODatabaseContext dbc = new EODatabaseContext(new EODatabase(_model));
    EOAdaptorContext ac = dbc.adaptorContext();
    EOSynchronizationFactory sf = ((JDBCAdaptor) ac.adaptor()).plugIn().synchronizationFactory();

    NSMutableArray beforeOpenChannels = new NSMutableArray();
    Enumeration beforeChannelsEnum = ac.channels().objectEnumerator();
    while (beforeChannelsEnum.hasMoreElements()) {
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

  }

  public void executeSQL(String sql) throws SQLException {
    fixClassPath();
    EODatabaseContext databaseContext = new EODatabaseContext(new EODatabase(_model));
    EOAdaptorContext adaptorContext = databaseContext.adaptorContext();

    NSMutableArray beforeOpenChannels = new NSMutableArray();
    Enumeration beforeChannelsEnum = adaptorContext.channels().objectEnumerator();
    while (beforeChannelsEnum.hasMoreElements()) {
      EOAdaptorChannel channel = (EOAdaptorChannel) beforeChannelsEnum.nextElement();
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

    }
  }

  public Map externalTypes() {
    EODatabaseContext dbc = new EODatabaseContext(new EODatabase(_model));
    EOAdaptorContext ac = dbc.adaptorContext();
    NSDictionary jdbc2Info = ((JDBCAdaptor) ac.adaptor()).plugIn().jdbcInfo();
    return (Map) EOFSQLUtils53.toJavaCollections(jdbc2Info);
  }

 
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

      try {
        EODatabaseContext dbc = ERXEOAccessUtilities.databaseContextForEntityNamed((EOObjectStoreCoordinator) ec.rootObjectStore(), entityName);
        dbc.lock();
        try {
          EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
          EOAdaptorChannel channel = (EOAdaptorChannel) dbc.adaptorContext().channels().lastObject();
          NSArray result = channel.primaryKeysForNewRowsWithEntity(increasePkBy, entity);
          return (Long) ((NSDictionary) result.lastObject()).allValues().lastObject();
        } finally {
          dbc.unlock();
        }
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

     */
    public static NSArray selectObjectsOfEntityForSqlWithBindings( EOEditingContext ec, String entityName, String query, boolean refreshesCache, Integer fetchLimit, ERXSQLBinding... bindings ) {
        EODatabaseContext context = databaseContextForEntityName(ec,entityName);
        EOEntity entity = EOUtilities.entityNamed(ec, entityName);

        EOSQLExpression expression = context.adaptorContext().adaptor().expressionFactory().expressionForEntity( entity );

        String proceccedQuery = processedQueryString(query, expression, bindings);
        expression.setStatement(proceccedQuery);

        EOFetchSpecification spec = new EOFetchSpecification( entityName, null, null );
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

        if( entity.primaryKeyAttributes().count() > 1 ) {
            throw new RuntimeException("Multiple primary keys not supported.");
        }

        EOSQLExpression expression = databaseContext.adaptorContext().adaptor().expressionFactory().expressionForEntity( entity );
        expression.setStatement(processedQueryString(query, expression, bindings));

        EOFetchSpecification pkSpec = new EOFetchSpecification( entityName, null, null );
        pkSpec.setRefreshesRefetchedObjects(refreshesCache);
        pkSpec.setFetchesRawRows(true);
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

   */
  @SuppressWarnings("unchecked")
  public static void upgrade(EOEditingContext editingContext, EOAdaptorChannel channel, EOModel model, String entityName, String tagsRelationshipName, String tagEntityName) throws SQLException {
    EOEntity joinEntity = ERTaggableEntity.registerTaggable(model.entityNamed(entityName), tagsRelationshipName, model.modelGroup().entityNamed(tagEntityName), null);
    EODatabaseContext databaseContext = EODatabaseContext.registeredDatabaseContextForModel(model, editingContext);
    EOSchemaGeneration generation = databaseContext.adaptorContext().adaptor().synchronizationFactory();
    NSArray<EOSQLExpression> createTableStatements = generation.createTableStatementsForEntityGroup(new NSArray<EOEntity>(joinEntity));
    ERXJDBCUtilities.executeUpdateScript(channel, ERXMigrationDatabase._stringsForExpressions(createTableStatements));
  }
}
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.adaptorContext()

   */
  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) {
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.