Examples of BasicEntity


Examples of au.com.motodetail.base.entity.BasicEntity

                    //TODO: if this is repeated on different function, switch to EAGER FETCH, drop LAZY
                    //TODO: read Apress JPA2: A better approach, which we will discuss in Chapters 7 and 8,
                    // is to use projection queries to retrieve only the entity state
                    //  that will be displayed on the JSP page instead of retrieving full entity instances.
                    //TODO: Named Query !!!
                    BasicEntity tempItem = itemService.retrieveFullEntity(itemEntity);
                    //itemSavedRoles = (List<BasicRole>) tempItem.getRoles();
                   
                    //replace item
                    this.item = tempItem;
                }
View Full Code Here

Examples of au.com.motodetail.base.entity.BasicEntity

    //POST VIEW ACTIONS
    public String PostViewAction(String action, BasicEntity itemEntity)
    {
        log.warn("ItemBean::PostViewAction param: " + action);

        BasicEntity itemItem = new BasicEntity();
        switch(EntityAction.valueOf(action))
        {
            case CREATE:
                try
                {
View Full Code Here

Examples of au.com.motodetail.base.entity.BasicEntity

    public void update(BasicEntity basicEntity) {
        BaseUtil.writeLog("BasicEntityServiceImpl::update ID: " + basicEntity.getId());
        JPAUtil.createTransactionalEntityManager();

        //retrieve basicEntity from db to merge
        BasicEntity basicEntityTemp = basicEntityDao.retrieve(basicEntity.getId());

        //modify here
        basicEntityTemp.setEntityType(basicEntity.getEntityType());
        basicEntityTemp.setRoles(basicEntity.getRoles());

        //commit changes
        basicEntityDao.update(basicEntityTemp);

        //commit transaction
View Full Code Here

Examples of au.com.motodetail.base.entity.BasicEntity

    @Override
    public BasicEntity getById(Long id) {
        BaseUtil.writeLog("BasicEntityServiceImpl::getById ID: " + id);
        JPAUtil.createEntityManager();
        BasicEntity result = basicEntityDao.retrieve(id);
        JPAUtil.closeEntityManager();
        return result;
    }
View Full Code Here

Examples of org.apache.cayenne.jpa.itest.ch9.entity.BasicEntity

                "id", "basicDefault", "basicDefaultInt"
        }, new Object[] {
                1, "a", 67
        });

        BasicEntity o1 = getEntityManager().find(BasicEntity.class, 1);
        assertEquals("a", o1.getBasicDefaultX());
        assertEquals(67, o1.getBasicDefaultIntX());
    }
View Full Code Here

Examples of org.apache.cayenne.jpa.itest.ch9.entity.BasicEntity

                "id", "basicEager"
        }, new Object[] {
                2, "b"
        });

        BasicEntity o1 = getEntityManager().find(BasicEntity.class, 2);
        assertEquals("b", o1.getBasicEagerX());
    }
View Full Code Here

Examples of org.apache.cayenne.jpa.itest.ch9.entity.BasicEntity

                "id", "basicLazy"
        }, new Object[] {
                3, "c"
        });

        BasicEntity o1 = getEntityManager().find(BasicEntity.class, 3);
        // application may or may not support lazy loading, but when the property is
        // accessed via getter, it must get resolved one way or another...
        assertEquals("c", o1.getBasicLazy());
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.relations.BasicEntity

    }

    public void testBasic() throws Exception {
        ClassMetaData cmd = repo.getMetaData(BasicEntity.class, null, true);
        try {
            JPAFacadeHelper.toOpenJPAObjectId(cmd, new BasicEntity());
            fail("Didn't fail!");
        } catch (UserException re) {
            // expected
        }
        try {
            JPAFacadeHelper.toOpenJPAObjectId(cmd, "a");
            fail("Didn't fail!");
        } catch (UserException re) {
            // expected
        }

        BasicEntity entity = new BasicEntity();

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        // Find the entity and retrieve the objectId we use internally
        BasicEntity persistedEntity = em.find(BasicEntity.class, entity.getId());
        StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
        Object oid = smi.getObjectId();

        assertEquals(oid, JPAFacadeHelper.toOpenJPAObjectId(cmd, entity.getId()));
        Object o = JPAFacadeHelper.toOpenJPAObjectId(cmd, entity.getId());
View Full Code Here

Examples of org.apache.openjpa.persistence.relations.BasicEntity

    }

    public void testBasic() throws Exception {
        ClassMetaData cmd = repo.getMetaData(BasicEntity.class, null, true);
        try {
            JPAFacadeHelper.toOpenJPAObjectId(cmd, new BasicEntity());
            fail("Didn't fail!");
        } catch (UserException re) {
            // expected
        }
        try {
View Full Code Here

Examples of org.apache.rave.persistence.BasicEntity

    private static final Long INVALID_ENTITY_ID = -1L;

    @Test
    public void getById_validId() {
        for (Repository repository : repositories) {
            BasicEntity entity = (BasicEntity)repository.get(VALID_ENTITY_ID);
            assertThat(entity, is(notNullValue()));
            assertThat(entity.getId(), is(equalTo(VALID_ENTITY_ID)));
        }
    }
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.