Package org.ow2.easybeans.tests.common.ejbs.entity.ebstore

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


    /**
     * 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

     * 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

     * 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

     * 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

     * 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

     * 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

    /**
     * @see org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.ItfEntityFactory
     */
    public void createEntity() {
        eb = new EBStore(id);
        em.persist(eb);

        bean.createCheckEntity00();

        this.checkManaged();
View Full Code Here

     */
    @SuppressWarnings("boxing")
    public void checkManaged() {
        assertTrue(em.contains(eb), "The entity instance should be managed.");

        EBStore ebFind = em.find(EBStore.class, id);

        assertTrue(ebFind == eb, "The entity instances should be equals, "
                + "they are in the same persistence context.");

        bean.checkManaged();
View Full Code Here

    /**
     * @see org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.ItfEntityFactory
     */
    @SuppressWarnings("boxing")
    public void removeEntity() {
        EBStore ebFind = em.find(EBStore.class, id);
        if (ebFind != null) {
            em.remove(ebFind);
        }

        ItfPCtxLifetime00 beanRemove = (ItfPCtxLifetime00) ctx.lookup("ejb/ebFactory");
View Full Code Here

TOP

Related Classes of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

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.