Search in sources :

Example 11 with MorphiaOrganization

use of io.lumeer.storage.mongodb.model.MorphiaOrganization in project engine by Lumeer.

the class MorphiaOrganizationDao method updateOrganization.

@Override
public Organization updateOrganization(final String organizationId, final Organization organization) {
    MorphiaOrganization morphiaOrganization = new MorphiaOrganization(organization);
    morphiaOrganization.setId(organizationId);
    datastore.save(morphiaOrganization);
    return morphiaOrganization;
}
Also used : MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization)

Example 12 with MorphiaOrganization

use of io.lumeer.storage.mongodb.model.MorphiaOrganization in project engine by Lumeer.

the class MorphiaOrganizationDao method getOrganizations.

@Override
public List<Organization> getOrganizations(final DatabaseQuery query) {
    Query<MorphiaOrganization> organizationQuery = createOrganizationQuery(query);
    FindOptions findOptions = createFindOptions(query);
    return new ArrayList<>(organizationQuery.asList(findOptions));
}
Also used : FindOptions(org.mongodb.morphia.query.FindOptions) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) ArrayList(java.util.ArrayList)

Aggregations

MorphiaOrganization (io.lumeer.storage.mongodb.model.MorphiaOrganization)12 MorphiaPermissions (io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)6 Organization (io.lumeer.api.model.Organization)5 User (io.lumeer.api.model.User)5 AuthenticatedUser (io.lumeer.core.AuthenticatedUser)5 Before (org.junit.Before)5 MorphiaPermission (io.lumeer.storage.mongodb.model.embedded.MorphiaPermission)3 Test (org.junit.Test)3 Project (io.lumeer.api.model.Project)2 MorphiaProject (io.lumeer.storage.mongodb.model.MorphiaProject)2 ObjectId (org.bson.types.ObjectId)2 JsonOrganization (io.lumeer.api.dto.JsonOrganization)1 ArrayList (java.util.ArrayList)1 FindOptions (org.mongodb.morphia.query.FindOptions)1