Package org.apache.openjpa.persistence.merge.model

Examples of org.apache.openjpa.persistence.merge.model.Car


     */
    public void testCascadeMergeDetachStateComplex() {
        EntityManager em = emf.createEntityManager();

        try {
          Car c1 = new Car();
          Car c2 = new Car();
          Make mk1 = new Make();
          ArrayList<Model> models = new ArrayList<Model>();
          Model md1 = new Model();
          models.add(md1);
          Model md2 = new Model();
          models.add(md2);

          //populate bidirectional relationships
          c1.setModel(md1);
          c2.setModel(md2);         
          md1.setCar(c1);
          md1.setMake(mk1);
          md2.setCar(c2);
          md1.setMake(mk1);
          mk1.setModels(models);
View Full Code Here


  private void verifyDetached(EntityManager em, Object[] entities) {
        for (Object entity : entities) {
          assertFalse(em.contains(entity));
          if (entity instanceof Car) {
            Car c = (Car)entity;
            assertFalse(em.contains(c.getModel()));
          }
          else if (entity instanceof Make) {
            Make m = (Make)entity;
            List<Model> mds = m.getModels();
            for (Model md : mds) {
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.merge.model.Car

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.