use of io.crnk.core.queryspec.QuerySpec in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method getPostOnly.
@Test
public void getPostOnly() {
identityManager.addUser("doe", "doePass", "getRole", "postRole");
Project project = new Project();
project.setId(1L);
project.setName("test");
projectRepo.create(project);
project = projectRepo.findOne(project.getId(), new QuerySpec(Project.class));
Assert.assertNotNull(project);
}
use of io.crnk.core.queryspec.QuerySpec in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method permitAllMatchAnyType.
@Test
public void permitAllMatchAnyType() {
identityManager.addUser("doe", "doePass");
projectRepo.findAll(new QuerySpec(Project.class));
}
use of io.crnk.core.queryspec.QuerySpec in project crnk-framework by crnk-project.
the class QuerySpecAdapter method getIncludedRelations.
@Override
public TypedParams<IncludedRelationsParams> getIncludedRelations() {
Map<String, IncludedRelationsParams> params = new HashMap<>();
addRelations(params, querySpec);
for (QuerySpec relatedSpec : querySpec.getNestedSpecs()) {
addRelations(params, relatedSpec);
}
return new TypedParams<>(params);
}
use of io.crnk.core.queryspec.QuerySpec in project crnk-framework by crnk-project.
the class RelationshipRepositoryBase method getTargets.
@SuppressWarnings("unchecked")
protected Iterable<D> getTargets(RegistryEntry entry, Iterable<J> targetIds) {
ResourceRepositoryAdapter<D, J> targetAdapter = entry.getResourceRepository();
QueryAdapter queryAdapter = new QuerySpecAdapter(new QuerySpec(entry.getResourceInformation()), resourceRegistry);
return (Iterable<D>) targetAdapter.findAll(targetIds, queryAdapter).getEntity();
}
use of io.crnk.core.queryspec.QuerySpec in project crnk-framework by crnk-project.
the class RelationshipRepositoryBase method getSaveQueryAdapter.
protected QueryAdapter getSaveQueryAdapter(String fieldName) {
QuerySpec querySpec = newSourceQuerySpec();
querySpec.includeRelation(Arrays.asList(fieldName));
return new QuerySpecAdapter(querySpec, resourceRegistry);
}
Aggregations