コード例 #1
0
  private void processEntityBeanMetaData(
      final DeploymentUnit deploymentUnit, final EntityBeanMetaData entity)
      throws DeploymentUnitProcessingException {
    final EjbJarDescription ejbJarDescription = getEjbJarDescription(deploymentUnit);

    final String beanName = entity.getName();
    final String beanClassName = entity.getEjbClass();

    final EntityBeanComponentDescription description =
        new EntityBeanComponentDescription(
            beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName());
    // add it to the ejb jar description
    ejbJarDescription.getEEModuleDescription().addComponent(description);
    description.setDescriptorData(entity);

    description.setPersistenceType(entity.getPersistenceType());
    description.setReentrant(entity.isReentrant());
    description.setPrimaryKeyType(entity.getPrimKeyClass());
    // TODO: validation

    final String localHome = entity.getLocalHome();
    if (localHome != null) {
      description.addLocalHome(localHome);
    }

    final String local = entity.getLocal();
    if (local != null) {
      description.addEjbLocalObjectView(local);
    }
  }
コード例 #2
0
  @Override
  protected EntityBeanMetaData assertFullEntity(
      String ejbName, IEnterpriseBeansMetaData<?, ?, ?, ?> enterpriseBeansMetaData, Mode mode) {
    EntityBeanMetaData entity = assertEntity(ejbName + "EjbName", enterpriseBeansMetaData);
    assertId(ejbName, entity);
    assertMappedName(ejbName, entity.getMappedName());
    assertClass(ejbName, "Home", entity.getHome());
    assertClass(ejbName, "Remote", entity.getRemote());
    assertClass(ejbName, "LocalHome", entity.getLocalHome());
    assertClass(ejbName, "Local", entity.getLocal());
    assertClass(ejbName, "EjbClass", entity.getEjbClass());
    assertEquals(PersistenceType.Container, entity.getPersistenceType());
    assertEquals(ejbName + "PrimKeyClass", entity.getPrimKeyClass());
    assertTrue(entity.isReentrant());
    assertEquals("2.x", entity.getCmpVersion());
    assertFalse(entity.isCMP1x());
    assertEquals(ejbName + "AbstractSchemaName", entity.getAbstractSchemaName());
    assertCmpFields(ejbName, 2, entity.getCmpFields());
    assertEquals(ejbName + "PrimKeyField", entity.getPrimKeyField());
    assertEnvironment(ejbName, entity.getJndiEnvironmentRefsGroup(), true, mode);
    if (mode == Mode.SPEC) {
      assertContainerTransactions(ejbName, 6, 6, entity.getContainerTransactions());
      assertMethodPermissions(
          ejbName, ejbName + "MethodPermission", 3, 3, entity.getMethodPermissions());
      assertExcludeList(ejbName, 5, 5, entity.getExcludeList());
    } else {
      assertNull(entity.getContainerTransactions());
      assertNull(entity.getMethodPermissions());
      assertNull(entity.getExcludeList());
    }
    assertSecurityRoleRefs(ejbName, 2, entity.getSecurityRoleRefs());
    assertSecurityIdentity(ejbName, "SecurityIdentity", entity.getSecurityIdentity(), true, mode);
    assertQueries(ejbName, 3, entity.getQueries());

    return entity;
  }