Examples of HasMultiValuePropsJPA


Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strArrayList")).size());
  }

  public void testUpdateLinkedList_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    LinkedList<String> list = Utils.newLinkedList("a", "b");
    pojo.setStrLinkedList(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrLinkedList().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedList")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedList")).size());
  }

  public void testUpdateLinkedList_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    LinkedList<String> list = Utils.newLinkedList("a", "b");
    pojo.setStrLinkedList(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    list = Utils.newLinkedList("a", "b", "zoom");
    pojo.setStrLinkedList(list);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedList")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedList")).size());
  }

  public void testUpdateSet_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    Set<String> set = Utils.newHashSet("a", "b");
    pojo.setStrSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrSet().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSet")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSet")).size());
  }

  public void testUpdateSet_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    Set<String> set = Utils.newHashSet("a", "b");
    pojo.setStrSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    set = Utils.newHashSet("a", "b", "zoom");
    pojo.setStrSet(set);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSet")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSet")).size());
  }

  public void testUpdateHashSet_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    HashSet<String> set = Utils.newHashSet("a", "b");
    pojo.setStrHashSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrHashSet().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strHashSet")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strHashSet")).size());
  }

  public void testUpdateHashSet_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    HashSet<String> set = Utils.newHashSet("a", "b");
    pojo.setStrHashSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    set = Utils.newHashSet("a", "b", "zoom");
    pojo.setStrHashSet(set);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strHashSet")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strHashSet")).size());
  }

  public void testUpdateLinkedHashSet_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    LinkedHashSet<String> set = Utils.newLinkedHashSet("a", "b");
    pojo.setStrLinkedHashSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrLinkedHashSet().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedHashSet")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedHashSet")).size());
  }

  public void testUpdateLinkedHashSet_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    LinkedHashSet<String> set = Utils.newLinkedHashSet("a", "b");
    pojo.setStrLinkedHashSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    set = Utils.newLinkedHashSet("a", "b", "zoom");
    pojo.setStrLinkedHashSet(set);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedHashSet")).size());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

  public void testFetchSet() {
    Entity e = new Entity(HasMultiValuePropsJPA.class.getSimpleName());
    e.setProperty("strSet", Utils.newArrayList("a", "b", "c"));
    ds.put(e);

    HasMultiValuePropsJPA pojo = em.find(HasMultiValuePropsJPA.class, e.getKey().getId());
    assertEquals(Utils.newHashSet("a", "b", "c"), pojo.getStrSet());
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

  public void testFetchArrayList() {
    Entity e = new Entity(HasMultiValuePropsJPA.class.getSimpleName());
    e.setProperty("strArrayList", Utils.newArrayList("a", "b", "c"));
    ds.put(e);

    HasMultiValuePropsJPA pojo = em.find(HasMultiValuePropsJPA.class, e.getKey().getId());
    assertEquals(Utils.newArrayList("a", "b", "c"), pojo.getStrArrayList());
  }
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.