Search in sources :

Example 1 with HasReferenceToInCondition

use of org.bimserver.database.query.conditions.HasReferenceToInCondition in project BIMserver by opensourceBIM.

the class GetAllCheckoutsOfProjectDatabaseAction method execute.

@Override
public List<Checkout> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
    Project project = getProjectByPoid(poid);
    Set<Project> projects = new HashSet<Project>();
    if (checkSubProjects) {
        getSubProjects(project, projects);
    } else {
        projects.add(project);
    }
    Condition condition = new HasReferenceToInCondition(StorePackage.eINSTANCE.getCheckout_Project(), projects);
    Map<Long, Checkout> query = getDatabaseSession().query(condition, Checkout.class, OldQuery.getDefault());
    return CollectionUtils.mapToList(query);
}
Also used : Condition(org.bimserver.database.query.conditions.Condition) HasReferenceToInCondition(org.bimserver.database.query.conditions.HasReferenceToInCondition) Project(org.bimserver.models.store.Project) Checkout(org.bimserver.models.store.Checkout) HasReferenceToInCondition(org.bimserver.database.query.conditions.HasReferenceToInCondition) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Condition (org.bimserver.database.query.conditions.Condition)1 HasReferenceToInCondition (org.bimserver.database.query.conditions.HasReferenceToInCondition)1 Checkout (org.bimserver.models.store.Checkout)1 Project (org.bimserver.models.store.Project)1