Search in sources :

Example 6 with FormSchemaEntity

use of org.activityinfo.store.hrd.entity.FormSchemaEntity in project activityinfo by bedatadriven.

the class HrdStorageProvider method getFormClasses.

@Override
public Map<ResourceId, FormClass> getFormClasses(Collection<ResourceId> formIds) {
    Set<Key<FormSchemaEntity>> toLoad = new HashSet<>();
    for (ResourceId formId : formIds) {
        toLoad.add(FormSchemaEntity.key(formId));
    }
    Map<Key<FormSchemaEntity>, FormSchemaEntity> entityMap = ObjectifyService.ofy().load().keys(toLoad);
    Map<ResourceId, FormClass> formClassMap = new HashMap<>();
    for (FormSchemaEntity formSchema : entityMap.values()) {
        formClassMap.put(formSchema.getFormId(), formSchema.readFormClass());
    }
    return formClassMap;
}
Also used : ResourceId(org.activityinfo.model.resource.ResourceId) FormClass(org.activityinfo.model.form.FormClass) FormSchemaEntity(org.activityinfo.store.hrd.entity.FormSchemaEntity) Key(com.googlecode.objectify.Key)

Aggregations

FormSchemaEntity (org.activityinfo.store.hrd.entity.FormSchemaEntity)6 ResourceId (org.activityinfo.model.resource.ResourceId)3 FormEntity (org.activityinfo.store.hrd.entity.FormEntity)3 FormClass (org.activityinfo.model.form.FormClass)2 Key (com.googlecode.objectify.Key)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Iterator (java.util.Iterator)1 List (java.util.List)1 FormInstance (org.activityinfo.model.form.FormInstance)1 SubFormReferenceType (org.activityinfo.model.type.subform.SubFormReferenceType)1 FormRecordEntity (org.activityinfo.store.hrd.entity.FormRecordEntity)1 FormRecordSnapshotEntity (org.activityinfo.store.hrd.entity.FormRecordSnapshotEntity)1 CreateOrUpdateForm (org.activityinfo.store.hrd.op.CreateOrUpdateForm)1 ProjectTable (org.activityinfo.store.mysql.collections.ProjectTable)1 RecordCursor (org.activityinfo.store.mysql.cursor.RecordCursor)1 TableMapping (org.activityinfo.store.mysql.mapping.TableMapping)1 DatabaseCacheImpl (org.activityinfo.store.mysql.metadata.DatabaseCacheImpl)1 FormStorage (org.activityinfo.store.spi.FormStorage)1