Search in sources :

Example 1 with EntityRelationshipDao

use of org.finos.waltz.data.entity_relationship.EntityRelationshipDao in project waltz by khartec.

the class EntityRelationshipHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    EntityRelationshipDao dao = ctx.getBean(EntityRelationshipDao.class);
    EntityReference ref = EntityReference.mkRef(EntityKind.MEASURABLE, 613);
    Collection<EntityRelationship> rels = dao.findRelationshipsInvolving(ref);
    rels.forEach(r -> System.out.println(r.a().name()));
    System.out.println("----");
    System.out.println(dao.tallyRelationshipsInvolving(ref));
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) EntityRelationshipDao(org.finos.waltz.data.entity_relationship.EntityRelationshipDao) EntityReference(org.finos.waltz.model.EntityReference) EntityRelationship(org.finos.waltz.model.entity_relationship.EntityRelationship) DSLContext(org.jooq.DSLContext)

Aggregations

EntityRelationshipDao (org.finos.waltz.data.entity_relationship.EntityRelationshipDao)1 EntityReference (org.finos.waltz.model.EntityReference)1 EntityRelationship (org.finos.waltz.model.entity_relationship.EntityRelationship)1 DSLContext (org.jooq.DSLContext)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1