Package com.webobjects.eocontrol

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


                        pref.takeValueForKey(encodedValue,"value");
                    }
                } else {
                    if (log.isDebugEnabled())
                        log.debug("Removing preference "+u+": "+key);
                    ec.deleteObject(pref);
                }
            } else if (value!=null) {
                pref = ERXEOControlUtilities.createAndInsertObject(ec, "ERCPreference");
                u.newPreference(pref);
                // done this way to not force you to sub-class our User entity
View Full Code Here


      ec.lock();
      NSArray rowsInserted = EOUtilities.objectsMatchingKeyAndValue(ec, "Employee", "state", lastName);
      boolean insertOk = (rowsInserted.count() == iters);

      for (int idx = 0; idx < iters; idx++) {
        ec.deleteObject((EOEnterpriseObject) rowsInserted.get(idx));
      }
      ec.saveChanges();
      ec.unlock();

      ec.lock();
View Full Code Here

      ec.unlock();

      boolean deleteOk = (rowsDeleted.count() == 0);

      ec.lock();
      ec.deleteObject(company);
      ec.saveChanges();
      ec.unlock();

      end();
View Full Code Here

  }

  public static void deleteObjectsWithPrefix(String entityName, String prefix) {
    EOEditingContext ec = ERXEC.newEditingContext();
    for (Object obj : (NSArray<Object>)EOUtilities.objectsWithQualifierFormat(ec, entityName, "name = '"+prefix+"_*'", null)) {
      ec.deleteObject((EOEnterpriseObject)obj);
    }
    ec.saveChanges();
  }
 
  /**
 
View Full Code Here

            bug.setSubject("Test");
            ec.saveChanges();
            bug.setSubject("Test1");
            bug.setOwner(People.clazz.anyUser(ec));
            ec.saveChanges();
            ec.deleteObject(bug);
            ec.saveChanges();
            result = pageWithName("ERXSuccess");
        } catch (Exception e) {
            log.error(e);
        } finally {
View Full Code Here

    assertContainsExactlyEOs(new NSArray<Employee>(new Employee[] { employee2_osc1 }), company_osc2.employees());

    // ... Do someting with the deleted object in OSC2

    // Delete the remaining employee in OSC2 and Save
    editingContext_osc2.deleteObject(secondEmployee_osc2);
    editingContext_osc2.saveChanges();
    sleep();

    // Fetch and check employees for Company1 in OSC1
    assertContainsExactlyEOs(NSArray.EmptyArray, company_osc1.employees());
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.