Search in sources :

Example 1 with FlowPropertyDao

use of org.openlca.core.database.FlowPropertyDao in project olca-modules by GreenDelta.

the class FlowDescriptorTest method tearDown.

@After
public void tearDown() {
    flowDao.delete(flow);
    new FlowPropertyDao(db).delete(property);
}
Also used : FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) After(org.junit.After)

Example 2 with FlowPropertyDao

use of org.openlca.core.database.FlowPropertyDao in project olca-modules by GreenDelta.

the class FlowDescriptorTest method setUp.

@Before
public void setUp() {
    property = new FlowProperty();
    property = new FlowPropertyDao(db).insert(property);
    flow = new Flow();
    flow.referenceFlowProperty = property;
    flow = flowDao.insert(flow);
}
Also used : FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) FlowProperty(org.openlca.core.model.FlowProperty) Flow(org.openlca.core.model.Flow) Before(org.junit.Before)

Example 3 with FlowPropertyDao

use of org.openlca.core.database.FlowPropertyDao in project olca-modules by GreenDelta.

the class FlowPropertyFactorUseSearchTest method setup.

@Before
public void setup() {
    flow = new Flow();
    flow.name = "flow";
    property = new FlowProperty();
    property.name = "property";
    factor = new FlowPropertyFactor();
    factor.flowProperty = property;
    flow.flowPropertyFactors.add(factor);
    property = new FlowPropertyDao(database).insert(property);
    flow = new FlowDao(database).insert(flow);
    factor = flow.getFactor(property);
    search = new FlowPropertyFactorUseSearch(flow, database);
}
Also used : FlowDao(org.openlca.core.database.FlowDao) FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) FlowPropertyFactor(org.openlca.core.model.FlowPropertyFactor) FlowProperty(org.openlca.core.model.FlowProperty) Flow(org.openlca.core.model.Flow) Before(org.junit.Before)

Example 4 with FlowPropertyDao

use of org.openlca.core.database.FlowPropertyDao 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));
}
Also used : SourceDao(org.openlca.core.database.SourceDao) CurrencyDao(org.openlca.core.database.CurrencyDao) ImpactCategoryDao(org.openlca.core.database.ImpactCategoryDao) CategoryDao(org.openlca.core.database.CategoryDao) ActorDao(org.openlca.core.database.ActorDao) FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) LocationDao(org.openlca.core.database.LocationDao) UnitDao(org.openlca.core.database.UnitDao) DQSystemDao(org.openlca.core.database.DQSystemDao) NwSetDao(org.openlca.core.database.NwSetDao) FlowDao(org.openlca.core.database.FlowDao) ImpactMethodDao(org.openlca.core.database.ImpactMethodDao) ProcessDao(org.openlca.core.database.ProcessDao) UnitGroupDao(org.openlca.core.database.UnitGroupDao) SocialIndicatorDao(org.openlca.core.database.SocialIndicatorDao) ImpactCategoryDao(org.openlca.core.database.ImpactCategoryDao) ProductSystemDao(org.openlca.core.database.ProductSystemDao) ProjectDao(org.openlca.core.database.ProjectDao)

Example 5 with FlowPropertyDao

use of org.openlca.core.database.FlowPropertyDao in project olca-modules by GreenDelta.

the class FlowPropertySheet method write.

private void write() {
    Excel.trackSize(sheet, 0, 7);
    writeHeader();
    var dao = new FlowPropertyDao(config.database);
    var properties = dao.getAll();
    properties.sort(new EntitySorter());
    for (FlowProperty property : properties) {
        row++;
        write(property);
    }
    Excel.autoSize(sheet, 0, 7);
}
Also used : FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) FlowProperty(org.openlca.core.model.FlowProperty)

Aggregations

FlowPropertyDao (org.openlca.core.database.FlowPropertyDao)20 FlowProperty (org.openlca.core.model.FlowProperty)14 FlowDao (org.openlca.core.database.FlowDao)7 UnitGroupDao (org.openlca.core.database.UnitGroupDao)7 ProcessDao (org.openlca.core.database.ProcessDao)5 Flow (org.openlca.core.model.Flow)5 Unit (org.openlca.core.model.Unit)5 UnitGroup (org.openlca.core.model.UnitGroup)5 IDatabase (org.openlca.core.database.IDatabase)3 UnitDao (org.openlca.core.database.UnitDao)3 Process (org.openlca.core.model.Process)3 ArrayList (java.util.ArrayList)2 After (org.junit.After)2 Before (org.junit.Before)2 Test (org.junit.Test)2 CategoryDao (org.openlca.core.database.CategoryDao)2 LocationDao (org.openlca.core.database.LocationDao)2 ProductSystemDao (org.openlca.core.database.ProductSystemDao)2 FlowPropertyFactor (org.openlca.core.model.FlowPropertyFactor)2 FlowType (org.openlca.core.model.FlowType)2