Examples of EBStore


Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

    /**
     * Removes the entity that is in the database.
     * @param id the entity primary key.
     */
    public void removeEBStore(final int id) {
        EBStore ebstore = em.find(EBStore.class, new Integer(id));
        if(ebstore != null){
            em.remove(ebstore);
        }
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

    public void setFlushModeAuto() {
        entityManager.setFlushMode(FlushModeType.AUTO);
        assertEquals(entityManager.getFlushMode(), FlushModeType.AUTO,
        "The flush mode was not set.");

        EBStore ebstoreBeforeChange = entityManager.find(EBStore.class, ENTITY_ID);
        ebstoreBeforeChange.setName(ENTITY_NAME_2);
        // forces a flush
        entityManager.createQuery("SELECT e FROM EBStore e");
        // verifies if the flush was made
        EBStore ebstoreAfterChange = entityManager.find(EBStore.class, ENTITY_ID);
        assertEquals(ebstoreAfterChange.getName(), ENTITY_NAME_2, "The container did not make a flush after the query");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

    public void setFlushModeCommit() {
        entityManager.setFlushMode(FlushModeType.COMMIT);
        assertEquals(entityManager.getFlushMode(), FlushModeType.COMMIT,
        "The flush mode was not set.");

        EBStore ebstoreBeforeChange = entityManager.find(EBStore.class, ENTITY_ID);
        ebstoreBeforeChange.setName(ENTITY_NAME_2);
        // forces a flush
        entityManager.createQuery("SELECT e FROM EBStore e");
        // verifies if the flush was not made
        EBStore ebstoreAfterChange = entityManager.find(EBStore.class, ENTITY_ID);
        assertEquals(ebstoreAfterChange.getName(), ENTITY_NAME, "The container made a flush after the query");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @param id the entity primary key.
     * @param name the entity name.
     * @return the ebstore completed.
     */
    private EBStore completeEBStore(final int id, final String name) {
        EBStore ebstore = new EBStore();
        ebstore.setId(id);
        ebstore.setName(name);
        return ebstore;
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

    /**
     * Removes the entity that is in the database.
     * @param id the entity primary key.
     */
    public void removeEBStore(final int id) {
        EBStore ebstore = findEBStore(id);
        if(ebstore != null){
            em.remove(ebstore);
        }
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * status is new, in the second persist, the bean status is managed.
     * @param id the primary key.
     * @param name the entity name.
     */
    public void createEBStoreManaged(final int id, final String name) {
        EBStore ebstore = completeEBStore(id, name);
        em.persist(ebstore);
        em.persist(ebstore);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * removed entity.
     * @param id the primary key.
     * @param name the entity name.
     */
    public void createEBStoreRemoved(final int id, final String name) {
        EBStore ebstore = completeEBStore(id, name);
        em.persist(ebstore);
        em.remove(ebstore);
        em.persist(ebstore);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * Creates the entity and tries to remove twice the same entity.
     * @param id the primary key.
     * @param name the entity name.
     */
    public void removeEBStoreRemoved(final int id, final String name) {
        EBStore ebstore = completeEBStore(id, name);
        em.persist(ebstore);
        em.remove(ebstore);
        em.remove(ebstore);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * Creates the entity and , after that, tries remove the same entity.
     * @param id the primary key.
     * @param name the entity name.
     */
    public void removeEBStoreManaged(final int id, final String name) {
        EBStore ebstore = completeEBStore(id, name);
        em.persist(ebstore);
        em.remove(ebstore);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * Tries remove the entity that is not persistent yet.
     * @param id the primary key.
     * @param name the entity name.
     */
    public void removeEBStoreNew(final int id, final String name) {
        EBStore ebstore = completeEBStore(id, name);
        em.remove(ebstore);
    }
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.