/** * If not already created, a new <code>persistence-unit</code> element will be created and returned. * Otherwise, the first existing <code>persistence-unit</code> element will be returned. * @return the instance defined for the element <code>persistence-unit</code> */ public PersistenceUnit<PersistenceDescriptor> getOrCreatePersistenceUnit() { List<Node> nodeList = model.get("persistence-unit"); if (nodeList != null && nodeList.size() > 0) { return new PersistenceUnitImpl<PersistenceDescriptor>(this, "persistence-unit", model, nodeList.get(0)); } return createPersistenceUnit(); }
/** * If not already created, a new <code>persistence-unit</code> element will be created and returned. * Otherwise, the first existing <code>persistence-unit</code> element will be returned. * @return the instance defined for the element <code>persistence-unit</code> */ public PersistenceUnit<PersistenceDescriptor> getOrCreatePersistenceUnit() { List<Node> nodeList = model.get("persistence-unit"); if (nodeList != null && nodeList.size() > 0) { return new PersistenceUnitImpl<PersistenceDescriptor>(this, "persistence-unit", model, nodeList.get(0)); } return createPersistenceUnit(); }