use of org.openlca.core.database.CategoryDao in project olca-modules by GreenDelta.
the class Sequence method init.
private void init(IDatabase db) {
index(CATEGORY, new CategoryDao(db));
index(LOCATION, new LocationDao(db));
index(ACTOR, new ActorDao(db));
index(SOURCE, new SourceDao(db));
index(UNIT, new UnitDao(db));
index(UNIT_GROUP, new UnitGroupDao(db));
index(FLOW_PROPERTY, new FlowPropertyDao(db));
index(FLOW, new FlowDao(db));
index(CURRENCY, new CurrencyDao(db));
index(PROCESS, new ProcessDao(db));
index(PRODUCT_SYSTEM, new ProductSystemDao(db));
index(IMPACT_CATEGORY, new ImpactCategoryDao(db));
index(IMPACT_METHOD, new ImpactMethodDao(db));
index(NW_SET, new NwSetDao(db));
index(PROJECT, new ProjectDao(db));
index(DQ_SYSTEM, new DQSystemDao(db));
index(SOCIAL_INDICATOR, new SocialIndicatorDao(db));
}
use of org.openlca.core.database.CategoryDao in project olca-modules by GreenDelta.
the class CategoryExport method doIt.
@Override
protected void doIt(CSVPrinter writer, IDatabase database) throws Exception {
log.trace("write categories");
CategoryDao dao = new CategoryDao(database);
List<Category> categories = dao.getAll();
for (Category category : categories) {
Object[] line = createLine(category);
writer.printRecord(line);
}
log.trace("{} categories written", categories.size());
}
use of org.openlca.core.database.CategoryDao in project olca-modules by GreenDelta.
the class ContactImport method createNew.
private Actor createNew() {
actor = new Actor();
var path = Categories.getPath(ilcdContact.getValue());
actor.category = new CategoryDao(config.db()).sync(ModelType.ACTOR, path);
setDescriptionAttributes();
setVersionTime();
return config.insert(actor);
}
use of org.openlca.core.database.CategoryDao in project olca-modules by GreenDelta.
the class SourceImport method createNew.
private Source createNew() {
source = new Source();
String[] path = Categories.getPath(ilcdSource.getValue());
source.category = new CategoryDao(config.db()).sync(ModelType.SOURCE, path);
setDescriptionAttributes();
importExternalFile();
return config.insert(source);
}
use of org.openlca.core.database.CategoryDao in project olca-modules by GreenDelta.
the class UnitGroupImport method createNew.
private UnitGroup createNew() {
unitGroup = new UnitGroup();
var path = Categories.getPath(ilcdUnitGroup.getValue());
unitGroup.category = new CategoryDao(config.db()).sync(ModelType.UNIT_GROUP, path);
mapDescriptionAttributes();
createUnits();
return config.insert(unitGroup);
}
Aggregations