Package er.rest.example.model

Examples of er.rest.example.model.Person


  protected boolean isAutomaticHtmlRoutingEnabled() {
    return true;
  }

  protected Person person() {
    Person person = routeObjectForKey("person");
    return person;
  }
View Full Code Here


    return filter;
  }
 
  @Override
  public WOActionResults createAction() {
    Person person = create(updateFilter());
    editingContext().saveChanges();
    return response(person, showFilter());
  }
View Full Code Here

    return response(person, showFilter());
  }

  @Override
  public WOActionResults updateAction() {
    Person person = person();
    update(person, updateFilter());
    editingContext().saveChanges();
    return response(person, showFilter());
  }
View Full Code Here

   * lockedUpdate is just like update except that the "company" relationships is locked, which means
   * that you can update the object on the other side of the relationship, but you can't change the
   * related object itself.
   */
  public WOActionResults lockedUpdateAction() {
    Person person = person();
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Person.COMPANY).includeAttributes(); // let you update a company inside of a person
    filter.lockRelationship(Person.COMPANY); // don't let you change the company relationship
    update(person, filter);
    editingContext().saveChanges();
View Full Code Here

  /**
   * securityUpdate is just like a regular update except that it will not let you change the person's
   * company name to Microsoft when updating the Person using the ERXKeyFilter.Delegate API
   */
  public WOActionResults securityUpdateAction() {
    Person person = person();
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    filter.include(Person.COMPANY).includeAttributes(); // let you update a company inside of a person
    filter.setDelegate(new ERXKeyFilter.Delegate() {
      public void willTakeValueForKey(Object target, Object value, String key) throws SecurityException {
        if (target instanceof Company && "name".equals(key) && value != null && ((String)value).contains("Microsoft")) {
View Full Code Here

    return response(person, showFilter());
  }
 
  @Override
  public WOActionResults destroyAction() throws Throwable {
    Person person = person();
    person.delete();
    editingContext().saveChanges();
    return response(person, showFilter());
  }
View Full Code Here

    return response(person, showFilter());
  }

  @Override
  public WOActionResults newAction() throws Throwable {
    Person person = Person.createPerson(editingContext(), "New Person");
    return response(person, showFilter());
  }
View Full Code Here

  public void postUpgrade(EOEditingContext editingContext, EOModel model) throws Throwable {
    Company c1 = Company.createCompany(editingContext, "mDT");
    Company c2 = Company.createCompany(editingContext, "Apple");
    Company c3 = Company.createCompany(editingContext, "Microsoft");
    Person p1 = Person.createPerson(editingContext, "Mike");
    p1.setCompanyRelationship(c1);
    Animal a1 = Animal.createAnimal(editingContext, "Derby", p1);
    Animal a2 = Animal.createAnimal(editingContext, "Sydney", p1);
    Person p2 = Person.createPerson(editingContext, "Adam");
    p2.setCompanyRelationship(c1);
    Animal a3 = Animal.createAnimal(editingContext, "Franny", p2);
  }
View Full Code Here

TOP

Related Classes of er.rest.example.model.Person

Copyright © 2018 www.massapicom. 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.