Examples of rootObjectStore()


Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

    if(false) {
      // AK: this should actually be the correct way...
      EOEditingContext ec = ERXEC.newEditingContext();
      ec.lock();
      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);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

    protected class AttributeTransactionHandler extends TransactionHandler {
       
        @Override
        public void _handleChanges(NSNotification n) {
            EOEditingContext ec = (EOEditingContext) n.object();
            if (ec.parentObjectStore() == ec.rootObjectStore()) {

                String notificationName = n.name();
                if (notificationName.equals(ERXEC.EditingContextWillSaveChangesNotification)) {
                    ec.processRecentChanges();
                    NSArray inserted = ec.insertedObjects();
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

        }

        @Override
    public void _handleChanges(NSNotification n) {
            EOEditingContext ec = (EOEditingContext) n.object();
            if (ec.parentObjectStore() == ec.rootObjectStore()) {

                String notificationName = n.name();
                if (notificationName.equals(ERXEC.EditingContextWillSaveChangesNotification)) {
                    ec.processRecentChanges();
                    NSArray inserted = ec.insertedObjects();
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

     * @param relationshipName relationship name
     * @param database database object
     */
    public static void clearSnapshotForRelationshipNamedInDatabase(EOEnterpriseObject eo, String relationshipName, EODatabase database) {
        EOEditingContext ec = eo.editingContext();
        EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator) ec.rootObjectStore();
        osc.lock();
        try {
          EOGlobalID gid = ec.globalIDForObject(eo);
          database.recordSnapshotForSourceGlobalID(null, gid, relationshipName);
          Object o = eo.storedValueForKey(relationshipName);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

          Object o = eo.storedValueForKey(relationshipName);
          boolean needRefresh = false;
          if(o instanceof EOFaulting) {
            EOFaulting toManyArray = (EOFaulting)o;
              if (!toManyArray.isFault()) {
                EOFaulting tmpToManyArray = (EOFaulting)((EOObjectStoreCoordinator)ec.rootObjectStore()).arrayFaultWithSourceGlobalID(gid, relationshipName, ec);
                toManyArray.turnIntoFault(tmpToManyArray.faultHandler());
                needRefresh = true;
              }
          } else {
            EOFaulting tmpToManyArray = (EOFaulting)((EOObjectStoreCoordinator)ec.rootObjectStore()).arrayFaultWithSourceGlobalID(gid, relationshipName, ec);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

                EOFaulting tmpToManyArray = (EOFaulting)((EOObjectStoreCoordinator)ec.rootObjectStore()).arrayFaultWithSourceGlobalID(gid, relationshipName, ec);
                toManyArray.turnIntoFault(tmpToManyArray.faultHandler());
                needRefresh = true;
              }
          } else {
            EOFaulting tmpToManyArray = (EOFaulting)((EOObjectStoreCoordinator)ec.rootObjectStore()).arrayFaultWithSourceGlobalID(gid, relationshipName, ec);
            eo.takeStoredValueForKey(tmpToManyArray, relationshipName);
            needRefresh = true;
          }
          if(needRefresh && (eo instanceof ERXEnterpriseObject)) {
            ((ERXEnterpriseObject)eo).flushCaches();
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

     * @param eo the EO to get a database context for
     * @return the eo's database context
     */
    public static EODatabaseContext databaseContextForObject(EOEnterpriseObject eo) {
        EOEditingContext editingContext = eo.editingContext();
        EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator) editingContext.rootObjectStore();
        EODatabaseContext databaseContext = (EODatabaseContext) osc.objectStoreForObject(eo);
        return databaseContext;
    }
   
    /**
 
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

      }
    }

        if (ec == null) return;
       
        EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator) ec.rootObjectStore();

        osc.lock();
        try {

            NSArray rootKeyPathObjects = KeyPath.parseKeyPathStrings(keypaths);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.rootObjectStore()

  @SuppressWarnings("unchecked")
  public String createSchemaSQLForEntitiesInModelAndOptions(NSArray<EOEntity> entities, EOModel model, NSDictionary optionsCreate) {
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
      EODatabaseContext databaseContext = databaseContextForModel(model, (EOObjectStoreCoordinator) ec.rootObjectStore());
      // AK the default implementation loads the shared objects, and when
      // they don't exist, throw an an error
      // which is not very useful for schema generation
      // But you would probably want to exit soon after calling this....
      // EODatabaseContext databaseContext =
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.