/** * Add a persistence context reference for the CMP * persistence contexts to this EntityBean definition. * * @param bean The bean we're updating. * * @return Returns true if the context was added. Returns false if * the bean already is associated with the CMP persistence * context. */ private boolean addPersistenceContextRef(EntityBean bean) { // if a ref is already defined, skip this bean if (bean.getPersistenceContextRefMap().containsKey(JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME)) return false; PersistenceContextRef persistenceContextRef = new PersistenceContextRef(); persistenceContextRef.setName(JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME); persistenceContextRef.setPersistenceUnitName(CMP_PERSISTENCE_UNIT_NAME); bean.getPersistenceContextRef().add(persistenceContextRef); return true; }
/** * Add a persistence context reference for the CMP * persistence contexts to this EntityBean definition. * * @param bean The bean we're updating. * @return Returns true if the context was added. Returns false if * the bean already is associated with the CMP persistence * context. */ private boolean addPersistenceContextRef(final EntityBean bean) { // if a ref is already defined, skip this bean if (bean.getPersistenceContextRefMap().containsKey("java:" + JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME)) { return false; } final PersistenceContextRef persistenceContextRef = new PersistenceContextRef(); persistenceContextRef.setName("java:" + JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME); persistenceContextRef.setPersistenceUnitName(CMP_PERSISTENCE_UNIT_NAME); bean.getPersistenceContextRef().add(persistenceContextRef); return true; }
/** * Add a persistence context reference for the CMP * persistence contexts to this EntityBean definition. * * @param bean The bean we're updating. * @return Returns true if the context was added. Returns false if * the bean already is associated with the CMP persistence * context. */ private boolean addPersistenceContextRef(final EntityBean bean) { // if a ref is already defined, skip this bean if (bean.getPersistenceContextRefMap().containsKey("java:" + JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME)) { return false; } final PersistenceContextRef persistenceContextRef = new PersistenceContextRef(); persistenceContextRef.setName("java:" + JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME); persistenceContextRef.setPersistenceUnitName(CMP_PERSISTENCE_UNIT_NAME); bean.getPersistenceContextRef().add(persistenceContextRef); return true; }