}
private EnterpriseBeanInfo initEntityBean(EntityBean e, Map m) throws OpenEJBException {
EntityBeanInfo bean = new EntityBeanInfo();
EjbDeployment d = (EjbDeployment) m.get(e.getEjbName());
if (d == null) {
throw new OpenEJBException("No deployment information in openejb-jar.xml for bean "
+ e.getEjbName()
+ ". Please redeploy the jar");
}
bean.ejbDeploymentId = d.getDeploymentId();
bean.containerId = d.getContainerId();
Icon icon = e.getIcon();
bean.largeIcon = (icon == null) ? null : icon.getLargeIcon();
bean.smallIcon = (icon == null) ? null : icon.getSmallIcon();
bean.description = e.getDescription();
bean.displayName = e.getDisplayName();
bean.ejbClass = e.getEjbClass();
bean.abstractSchemaName = e.getAbstractSchemaName();
bean.ejbName = e.getEjbName();
bean.home = e.getHome();
bean.remote = e.getRemote();
bean.localHome = e.getLocalHome();
bean.local = e.getLocal();
bean.transactionType = "Container";
bean.primKeyClass = e.getPrimKeyClass();
bean.primKeyField = e.getPrimkeyField();
bean.persistenceType = e.getPersistenceType().toString();
bean.reentrant = e.getReentrant() + "";
bean.properties.putAll(d.getProperties());
CmpVersion cmpVersion = e.getCmpVersion();
if (e.getPersistenceType() == PersistenceType.CONTAINER) {
if (cmpVersion != null && cmpVersion == CmpVersion.CMP1){
bean.cmpVersion = 1;
} else {
bean.cmpVersion = 2;
}
}
List<CmpField> cmpFields = e.getCmpField();
for (CmpField cmpField : cmpFields) {
bean.cmpFieldNames.add(cmpField.getFieldName());
}
if (bean.persistenceType.equalsIgnoreCase("Container")) {
for (Query q : e.getQuery()) {
QueryInfo query = new QueryInfo();
query.queryStatement = q.getEjbQl().trim();
MethodInfo method = new MethodInfo();
method.ejbName = bean.ejbName;
method.className = "*";
QueryMethod qm = q.getQueryMethod();
method.methodName = qm.getMethodName();
if (qm.getMethodParams() != null) {
method.methodParams = qm.getMethodParams().getMethodParam();
}
query.method = method;
ResultTypeMapping resultType = q.getResultTypeMapping();
if (ResultTypeMapping.REMOTE.equals(resultType)) {
query.remoteResultType = true;
}
bean.queries.add(query);
}
for (org.apache.openejb.jee.oejb3.Query q : d.getQuery()) {
QueryInfo query = new QueryInfo();
query.description = q.getDescription();
query.queryStatement = q.getObjectQl().trim();
MethodInfo method = new MethodInfo();