Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.EntityBean


        StatefulBean stateful = new StatefulBean(FooStateful.class);
        stateful.setHomeAndRemote("WrongHome", "WrongRemote");
        stateful.setLocal("WrongLocal");
        stateful.setLocalHome("WrongLocalHome");
        ejbJar.addEnterpriseBean(stateful);
        EntityBean bmpEntityBean = new EntityBean(FooEntityBMP.class, PersistenceType.BEAN);
        bmpEntityBean.setHome("WrongHome");
        bmpEntityBean.setLocalHome("WrongLocalHome");
        bmpEntityBean.setRemote("WrongRemote");
        bmpEntityBean.setLocal("WrongLocal");
        ejbJar.addEnterpriseBean(bmpEntityBean);
        EntityBean cmpEntityBean = new EntityBean(FooEntityCMP.class, PersistenceType.CONTAINER);
        cmpEntityBean.setHome("WrongHome");
        cmpEntityBean.setLocalHome("WrongLocalHome");
        cmpEntityBean.setRemote("WrongRemote");
        cmpEntityBean.setLocal("WrongLocal");
        ejbJar.addEnterpriseBean(cmpEntityBean);
        return ejbJar;
    }
View Full Code Here


                result = false;

                String paramString = getParameters(create);

                if (b instanceof EntityBean) {
                    EntityBean entity = (EntityBean) b;

                    fail(b, "entity.no.ejb.create", b.getEjbClass(), entity.getPrimKeyClass(), ejbCreateName.toString(), paramString);

                } else {
                    if (b instanceof SessionBean) {
                        SessionBean sb = (SessionBean) b;
                        // Under EJB 3.1, it is not required that a stateless session bean have an ejbCreate method, even when it has a home interface
View Full Code Here

    }

    public boolean isCmp(EnterpriseBean b) {

        if (b instanceof EntityBean) {
            EntityBean entityBean = (EntityBean) b;
            PersistenceType persistenceType = entityBean.getPersistenceType();
            return persistenceType == PersistenceType.CONTAINER;
        }
        return false;
    }
View Full Code Here

        Set<String> abstractSchemaNames = new HashSet<String>();
        for (EjbModule ejbModule : appModule.getEjbModules()) {
            for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
                if (isCmpEntity(bean)) {
                    EntityBean entity = (EntityBean) bean;
                    String name = entity.getAbstractSchemaName();
                    if (name != null) {
                        abstractSchemaNames.add(name);
                    }
                }
            }
View Full Code Here

            if (ejbDeployment.getContainerId() == null && annotation != null && isDefined(annotation.container())) {
                ejbDeployment.setContainerId(annotation.container());
            }

            if (isCmpEntity(bean)) {
                EntityBean entity = (EntityBean) bean;
                if (entity.getAbstractSchemaName() == null) {
                    String abstractSchemaName = bean.getEjbName().trim().replaceAll("[ \\t\\n\\r-]+", "_");

                    // The AbstractSchemaName must be unique, we should check that it is
                    if (abstractSchemaNames.contains(abstractSchemaName)) {
                        int i = 2;
                        while (abstractSchemaNames.contains(abstractSchemaName + i)) {
                             i++;
                        }
                        abstractSchemaName = abstractSchemaName + i;
                    }

                    abstractSchemaNames.add(abstractSchemaName);
                    entity.setAbstractSchemaName(abstractSchemaName);
                }
            }
        }

        return ejbModule;
View Full Code Here

    }

    public boolean isCmp(EnterpriseBean b) {

        if (b instanceof EntityBean) {
            EntityBean entityBean = (EntityBean) b;
            PersistenceType persistenceType = entityBean.getPersistenceType();
            return persistenceType == PersistenceType.CONTAINER;
        }
        return false;
    }
View Full Code Here

    Mockery context = new Mockery();
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        AppModule appModule = new TestFixture().getAppModule("notablename-ejb-jar.xml", "notablename-openejb-jar.xml");
    Entity entity = appModule.getCmpMappings().getEntityMap().get("openejb.java.lang.Product");
    EntityBean entityBean = (EntityBean) appModule.getEjbModules().get(0).getEjbJar().getEnterpriseBean("ProductEJB");
   
    new EntityBeanConverter(jdtFacade).addTableAnnotation(entityBean, entity);
  }
View Full Code Here

    Mockery context = new Mockery();
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        AppModule appModule = new TestFixture().getAppModule("basicentity-ejb-jar.xml", "basicentity-openejb-jar.xml");
    Entity entity = appModule.getCmpMappings().getEntityMap().get("openejb.java.lang.Product");
    EntityBean entityBean = (EntityBean) appModule.getEjbModules().get(0).getEjbJar().getEnterpriseBean("ProductEJB");
   
    context.checking(new Expectations() {
      {
        Map<String,Object> properties = new HashMap<String, Object>();
        properties.put("name", "products");
View Full Code Here

    Mockery context = new Mockery();
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        AppModule appModule = new TestFixture().getAppModule("basicentity-ejb-jar.xml", "basicentity-openejb-jar.xml");
    Entity entity = appModule.getCmpMappings().getEntityMap().get("openejb.java.lang.Product");
    EntityBean entityBean = (EntityBean) appModule.getEjbModules().get(0).getEjbJar().getEnterpriseBean("ProductEJB");
   
    context.checking(new Expectations() {
      {
        Map<String, Object> nameColumnProperties = new HashMap<String, Object>();
        nameColumnProperties.put("name", "name");
View Full Code Here

        String ejbJarFilename = "basicentity-ejb-jar.xml";
        String openejbJarFilename = "basicentity-openejb-jar.xml";

        AppModule appModule = new TestFixture().getAppModule(ejbJarFilename, openejbJarFilename);
    Entity entity = appModule.getCmpMappings().getEntityMap().get("openejb.java.lang.Product");
    EntityBean entityBean = (EntityBean) appModule.getEjbModules().get(0).getEjbJar().getEnterpriseBean("ProductEJB");
   
    context.checking(new Expectations() {
      {
        one(jdtFacade).addMethodAnnotation("org.superbiz.ProductBean", "getId", new String[0], Id.class, null);
        Map<String, Object> generatedvalueProps = new HashMap<String, Object>();
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.EntityBean

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.