Examples of EBStore


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

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

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

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

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

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

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

     * @see org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.ItfPCtxLifetime00
     */
    @SuppressWarnings("boxing")
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void createCheckEntity00() {
        eb = new EBStore(id);
        em.persist(eb);

        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.");
    }
View Full Code Here

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

     * @see org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.ItfPCtxLifetime00
     */
    @SuppressWarnings("boxing")
    @TransactionAttribute(TransactionAttributeType.NEVER)
    public void createCheckEntity01() {
        eb = new EBStore(id);
        em.persist(eb);

        assertFalse(em.contains(eb), "The entity instance should be detached.");
    }
View Full Code Here

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

    @SuppressWarnings("boxing")
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    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.");
    }
View Full Code Here

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

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

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

     * @param id the primary key.
     * @param name the entity name.
     * @return a new entity with the values.
     */
    private EBStore createBean(final Integer id, final String name) {
        EBStore ebstore = new EBStore();
        ebstore.setId(id.intValue());
        ebstore.setName(name);
        return ebstore;
    }
View Full Code Here

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

    /**
     * Removes the beans of the database.
     *
     */
    private void removeEBStore(){
        EBStore ebstoreTransaction = entityManagerTransaction.find(EBStore.class, ID_TRANSACTION);
        if(ebstoreTransaction != null){
            entityManagerTransaction.remove(ebstoreTransaction);
        }

        EBStore ebstoreExtended = entityManagerExtended.find(EBStore.class, ID_EXTENDED);
        if(ebstoreExtended != null){
            entityManagerExtended.remove(ebstoreExtended);
        }

    }
View Full Code Here

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

     * Verifies if the bean created in transaction-scoped persistence context in
     * the startup method, and, a bean that was goten using the find method have
     * different reference.
     */
    public void testTransactionPersistenceContext() {
        EBStore ebstoreResult = entityManagerTransaction.find(EBStore.class, ID_TRANSACTION);
        assertFalse(ebstoreResult == ebstoreTransaction,
                "The entities were goten in diferents persistence context, so they should not have the same reference.");
    }
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.