use of org.apache.cayenne.project.upgrade.UpgradeUnit in project cayenne by apache.
the class CompatibilityUpgradeService method upgradeDataMap.
public Resource upgradeDataMap(Resource resource) {
List<UpgradeHandler> handlerList = getHandlersForVersion(loadProjectVersion(resource));
Document document = Util.readDocument(resource.getURL());
UpgradeUnit upgradeUnit = new UpgradeUnit(resource, document);
for (UpgradeHandler handler : handlerList) {
handler.processDataMapDom(upgradeUnit);
}
documentProvider.putDocument(upgradeUnit.getResource().getURL(), upgradeUnit.getDocument());
return upgradeUnit.getResource();
}
use of org.apache.cayenne.project.upgrade.UpgradeUnit in project cayenne by apache.
the class BaseUpgradeHandlerTest method processDataMapDom.
Document processDataMapDom(String xmlResourceName) throws Exception {
UpgradeUnit unit = new UpgradeUnit(new URLResource(getClass().getResource(xmlResourceName)), documentFromResource(xmlResourceName));
handler.processDataMapDom(unit);
return unit.getDocument();
}
use of org.apache.cayenne.project.upgrade.UpgradeUnit in project cayenne by apache.
the class BaseUpgradeHandlerTest method processProjectDom.
Document processProjectDom(String xmlResourceName) throws Exception {
UpgradeUnit unit = new UpgradeUnit(new URLResource(getClass().getResource(xmlResourceName)), documentFromResource(xmlResourceName));
handler.processProjectDom(unit);
return unit.getDocument();
}
use of org.apache.cayenne.project.upgrade.UpgradeUnit in project cayenne by apache.
the class CompatibilityUpgradeService method upgradeProject.
@Override
public Resource upgradeProject(Resource resource) {
List<UpgradeHandler> handlerList = getHandlersForVersion(loadProjectVersion(resource));
List<UpgradeUnit> upgradeUnits = upgradeDOM(resource, handlerList);
for (UpgradeUnit unit : upgradeUnits) {
documentProvider.putDocument(unit.getResource().getURL(), unit.getDocument());
}
return resource;
}
Aggregations