Examples of Kitten


Examples of org.hibernate.ejb.test.Kitten

    assertNotNull( id );

    // add a kitten to the cat - triggers PostCollectionRecreateEvent
    int postVersion = Cat.postVersion;
    em.getTransaction().begin();
    Kitten kitty = new Kitten();
    kitty.setName("kitty");
    List kittens = new ArrayList<Kitten>();
    kittens.add(kitty);
    cat.setKittens(kittens);
    em.getTransaction().commit();
    assertEquals("Post version should have been incremented.", postVersion + 1, Cat.postVersion);

    // add another kitten - triggers PostCollectionUpdateEvent.
    postVersion = Cat.postVersion;
    em.getTransaction().begin();
    Kitten tom = new Kitten();
    tom.setName("Tom");
    cat.getKittens().add(tom);
    em.getTransaction().commit();
    assertEquals("Post version should have been incremented.", postVersion + 1, Cat.postVersion);

    // delete a kitty - triggers PostCollectionUpdateEvent
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.