Package er.cayenne.example.persistent

Examples of er.cayenne.example.persistent.Painting


    // Creating other objects
    Gallery metropolitan = objContext.newObject(Gallery.class);
    metropolitan.setName("Metropolitan Museum of Art");

    Painting girl = objContext.newObject(Painting.class);
    girl.setName("Girl Reading at a Table");

    Painting stein = objContext.newObject(Painting.class);
    stein.setName("Gertrude Stein");

    // connecting objects together via relationships
    picasso.addToPaintings(girl);
    picasso.addToPaintings(stein);

    girl.setGallery(metropolitan);
    stein.setGallery(metropolitan);

    // saving all the changes above
    objContext.commitChanges();
  }
View Full Code Here


    }
    public void removeFromPaintings(Painting obj) {
        removeToManyTarget("paintings", obj, true);
    }
    public Painting createPaintingsRelationship() {
      Painting obj = getObjectContext().newObject(Painting.class);
        addToManyTarget("paintings", obj, true);
        return obj;
    }
View Full Code Here

    public static final String ID_PK_COLUMN = "ID";

  public static Painting createPainting(ObjectContext ec
    , String name
  ) {
    Painting result = new Painting();
    ec.registerNewObject(result);
    result.setName(name);
    return result;
  }
View Full Code Here

   }
  
  
  public static Painting fetchOne(ObjectContext oc, Expression expression) {
    java.util.List<Painting> objects = fetch(oc, expression);
    Painting obj;
    int count = objects.size();
    if (count == 0) {
      obj = null;
    } else if (count == 1) {
      obj = objects.get(0);
View Full Code Here

    }
    public void removeFromPaintings(Painting obj) {
        removeToManyTarget("paintings", obj, true);
    }
    public Painting createPaintingsRelationship() {
      Painting obj = getObjectContext().newObject(Painting.class);
        addToManyTarget("paintings", obj, true);
        return obj;
    }
View Full Code Here

TOP

Related Classes of er.cayenne.example.persistent.Painting

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.