Assert.isNotNull(states, "states"); //$NON-NLS-1$
if (states.isEmpty())
return new ArrayList<INews>(0);
try {
Query query = fDb.query();
query.constrain(News.class);
query.descend("fFeedLink").constrain(feedRef.getLink().toString()); //$NON-NLS-1$
query.descend("fParentId").constrain(0); //$NON-NLS-1$
if (!states.containsAll(EnumSet.allOf(INews.State.class))) {
Constraint constraint = null;
for (INews.State state : states) {
if (constraint == null)
constraint = query.descend("fStateOrdinal").constrain(state.ordinal()); //$NON-NLS-1$
else
constraint = query.descend("fStateOrdinal").constrain(state.ordinal()).or(constraint); //$NON-NLS-1$
}
}
Collection<INews> news = getList(query);
activateAll(news);