use of org.motechproject.mds.filter.FilterValue in project motech by motech.
the class EntityServiceImpl method findEntitiesByPackage.
@Override
@Transactional
public List<EntityDto> findEntitiesByPackage(String packageName) {
List<EntityDto> entities = new ArrayList<>();
FilterValue filterValue = new FilterValue() {
@Override
public Object valueForQuery() {
return super.getValue();
}
@Override
public String paramTypeForQuery() {
return String.class.getName();
}
@Override
public List<String> operatorForQueryFilter() {
return Arrays.asList(".startsWith(", ")");
}
};
filterValue.setValue(packageName);
Filter filter = new Filter("className", new FilterValue[] { filterValue });
for (Entity entity : allEntities.filter(new Filters(filter), null, null)) {
if (entity.isActualEntity()) {
entities.add(entity.toDto());
}
}
return entities;
}
Aggregations