Examples of initEntity()


Examples of org.happyfaces.beans.base.BaseBean.initEntity()

                return new DummyPersistenceService();
            }
        };
       
        // test new instance of TestEntity is created when objectId is not set.
        IEntity initEntity = backingBean.initEntity();
        Assert.assertNotNull(initEntity);
        Assert.assertTrue(initEntity instanceof TestEntity);
        Assert.assertNull(initEntity.getId());
        backingBean.setObjectId(22L);
       
View Full Code Here

Examples of org.happyfaces.beans.base.BaseBean.initEntity()

        Assert.assertTrue(initEntity instanceof TestEntity);
        Assert.assertNull(initEntity.getId());
        backingBean.setObjectId(22L);
       
        //
        initEntity = backingBean.initEntity();
        Assert.assertNotNull(initEntity);
        Assert.assertTrue(initEntity instanceof TestEntity);
        Assert.assertEquals(Long.valueOf(22L), initEntity.getId());
       
        // not exist
View Full Code Here

Examples of org.happyfaces.beans.base.BaseBean.initEntity()

        Assert.assertTrue(initEntity instanceof TestEntity);
        Assert.assertEquals(Long.valueOf(22L), initEntity.getId());
       
        // not exist
        backingBean.setObjectId(23L);
        initEntity = backingBean.initEntity();
        Assert.assertNull(initEntity);
    }
   
    private static class DummyPersistenceService implements IService<TestEntity> {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore.initEntity()

    public static final CmpEntityBeanEjbCreateMethodInterceptorFactory INSTANCE = new CmpEntityBeanEjbCreateMethodInterceptorFactory();

    protected Object invokeEjbCreate(final InterceptorContext context, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
        final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance.class.cast(instance);
        final JDBCEntityPersistenceStore storeManager = cmpInstance.getComponent().getStoreManager();
        storeManager.initEntity(cmpInstance.getEjbContext());
        ejbCreate.invoke(instance.getInstance(), params);
        return storeManager.createEntity(context.getMethod(), context.getParameters(), cmpInstance.getEjbContext());
    }

    protected void invokeEjbPostCreate(final InterceptorContext context, final Method ejbPostCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore.initEntity()

    public static final CmpEntityBeanEjbCreateMethodInterceptorFactory INSTANCE = new CmpEntityBeanEjbCreateMethodInterceptorFactory();

    protected Object invokeEjbCreate(final InterceptorContext context, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
        final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance.class.cast(instance);
        final JDBCEntityPersistenceStore storeManager = cmpInstance.getComponent().getStoreManager();
        storeManager.initEntity(cmpInstance.getEjbContext());
        ejbCreate.invoke(instance.getInstance(), params);
        return storeManager.createEntity(context.getMethod(), context.getParameters(), cmpInstance.getEjbContext());
    }

    protected void invokeEjbPostCreate(final InterceptorContext context, final Method ejbPostCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore.initEntity()

    }

    protected Object invokeEjbCreate(final Map<Object, Object> contextData, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
        final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance.class.cast(instance);
        final JDBCEntityPersistenceStore storeManager = cmpInstance.getComponent().getStoreManager();
        storeManager.initEntity(cmpInstance.getEjbContext());
        ejbCreate.invoke(instance.getInstance(), params);
        return storeManager.createEntity(ejbCreate, params, cmpInstance.getEjbContext());
    }

    protected void invokeEjbPostCreate(final Map<Object, Object> contextData, final Method ejbPostCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore.initEntity()

    }

    protected Object invokeEjbCreate(final Map<Object, Object> contextData, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
        final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance.class.cast(instance);
        final JDBCEntityPersistenceStore storeManager = cmpInstance.getComponent().getStoreManager();
        storeManager.initEntity(cmpInstance.getEjbContext());
        try {
            ejbCreate.invoke(instance.getInstance(), params);
        } catch (InvocationTargetException ite) {
            throw Interceptors.rethrow(ite.getCause());
        }
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore.initEntity()

    }

    protected Object invokeEjbCreate(final Map<Object, Object> contextData, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
        final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance.class.cast(instance);
        final JDBCEntityPersistenceStore storeManager = cmpInstance.getComponent().getStoreManager();
        storeManager.initEntity(cmpInstance.getEjbContext());
        super.invokeEjbCreate(contextData, ejbCreate, instance, params);
        return storeManager.createEntity(ejbCreate, params, cmpInstance.getEjbContext());
    }

    protected void invokeEjbPostCreate(final Map<Object, Object> contextData, final Method ejbPostCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.JDBCEntityPersistenceStore.initEntity()

    public static final CmpEntityBeanEjbCreateMethodInterceptorFactory INSTANCE = new CmpEntityBeanEjbCreateMethodInterceptorFactory();

    protected Object invokeEjbCreate(final InterceptorContext context, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception {
        final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance.class.cast(instance);
        final JDBCEntityPersistenceStore storeManager = cmpInstance.getComponent().getStoreManager();
        storeManager.initEntity(cmpInstance.getEjbContext());

        super.invokeEjbCreate(context, ejbCreate, cmpInstance, params);

        return storeManager.createEntity(context.getMethod(), context.getParameters(), cmpInstance.getEjbContext());
    }
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.