Examples of database()


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

        results = ERXSQLHelper.newSQLHelper(ec, model.name()).rowCountForFetchSpecification(ec, spec);
      }
      catch (Exception localException) {
        if (dbc._isDroppedConnectionException(localException)) {
          try {
            dbc.database().handleDroppedConnection();
            results = ERXSQLHelper.newSQLHelper(ec, model.name()).rowCountForFetchSpecification(ec, spec);
          }
          catch (Exception ex) {
            throw NSForwardException._runtimeExceptionForThrowable(ex);
          }
View Full Code Here

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

         log.warn("Model " + model.name() + " failed: " + e.getMessage());
       }
       if (databaseContext != null) {
         databaseContext.lock();
         try {
           EODatabase database = databaseContext.database();
           if (!verifiedDatabases.containsObject(database)) {
             Enumeration gidEnum = database.snapshots().keyEnumerator();
             while (gidEnum.hasMoreElements()) {
               EOGlobalID gid = (EOGlobalID) gidEnum.nextElement();
               if (gid instanceof EOKeyGlobalID) {
View Full Code Here

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

        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.EODatabaseContext.database()

    // Note you can't use:
    // EOAdaptor.adaptorWithModel(e.entity().model()).expressionFactory();
    // as this creates a
    //
    EODatabaseContext context = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), EOObjectStoreCoordinator.defaultCoordinator());
    EOSQLExpressionFactory factory = context.database().adaptor().expressionFactory();

    NSArray subAttributes = destinationAttName != null ? new NSArray(entity.attributeNamed(destinationAttName)) : entity.primaryKeyAttributes();

    EOSQLExpression subExpression = factory.expressionForEntity(entity);
View Full Code Here

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

           
            EOQualifier qual = EOQualifierSQLGeneration.Support._schemaBasedQualifierWithRootEntity(subqualifier, destEntity);
            EOFetchSpecification fetchSpecification = new EOFetchSpecification(destEntity.name(), qual, null, false, true, null);

            EODatabaseContext context = EODatabaseContext.registeredDatabaseContextForModel(destEntity.model(), EOObjectStoreCoordinator.defaultCoordinator());
            EOSQLExpressionFactory factory = context.database().adaptor().expressionFactory();

            EOSQLExpression subExpression = factory.expressionForEntity(destEntity);
            subExpression.setUseAliases(true);
            subExpression.prepareSelectExpressionWithAttributes(destEntity.primaryKeyAttributes(), false, fetchSpecification);
View Full Code Here

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

            }

            //if entity caches objects, clear out the cache
            if( entity.cachesObjects() ) {
                EODatabaseContext databaseContext = EOUtilities.databaseContextForModelNamed(sharedEC, entity.model().name());
                EODatabase database = databaseContext.database();
                database.invalidateResultCacheForEntityNamed(entityName);
            }

            NSArray fetchSpecNames = entity.sharedObjectFetchSpecificationNames();
            int count =  (fetchSpecNames != null) ? fetchSpecNames.count() : 0;
View Full Code Here

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

    if (_entityStats == null) {
      _entityStats = new NSMutableDictionary<String, SEEntityStats>();
      EODatabaseContext databaseContext = EODatabaseContext.registeredDatabaseContextForModel(_model, ERXEC.newEditingContext());
      databaseContext.lock();
      try {
        EODatabase database = databaseContext.database();
        for (EOGlobalID gid : (NSArray<EOGlobalID>) database.snapshots().allKeys()) {
          if (gid instanceof EOKeyGlobalID) {
            EOKeyGlobalID kgid = (EOKeyGlobalID) gid;
            String entityName = kgid.entityName();
            SEEntityStats entityStats = _entityStats.get(entityName);
View Full Code Here

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

   * @return the database the database product name ("FrontBase",
   *         "PostgreSQL")
   */
  public static String databaseProductName(EOModel model) {
    EODatabaseContext databaseContext = EODatabaseContext.registeredDatabaseContextForModel(model, ERXEC.newEditingContext());
    EOAdaptor adaptor = databaseContext.database().adaptor();
    String databaseProductName;
    if (adaptor instanceof JDBCAdaptor) {
      databaseProductName = ((JDBCAdaptor) adaptor).plugIn().databaseProductName();
    }
    else {
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.algebra.Relation.database()

    newRelation.limit(1);
    Relation filteredRelation = newRelation.immutableSnapshot();
    SelectStatementBuilder builder = new SelectStatementBuilder(filteredRelation);
    String sql = builder.getSQLStatement();
    int contentColumn = builder.getColumnSpecs().indexOf(downloadMap.getContentDownloadColumn()) + 1;
      db = filteredRelation.database();
    Connection conn = db.connection();
    try {
      statement = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
      log.debug(sql);
View Full Code Here

Examples of net.sf.jabref.BasePanel.database()

      // added by
            //  the import inspection dialog.
            if (bibtexResult != null) {
                if (!openInNew) {
                    final BasePanel panel = (BasePanel) frame.getTabbedPane().getSelectedComponent();
                    BibtexDatabase toAddTo = panel.database();
                   
                    // Use the import inspection dialog if it is enabled in preferences, and
                    // (there are more than one entry or the inspection dialog is also enabled
                    // for single entries):
                    if (Globals.prefs.getBoolean("useImportInspectionDialog") &&
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.