@Override public Set<VariableValueSource> createSources() { Set<VariableValueSource> sources = new LinkedHashSet<>(); @SuppressWarnings("unchecked") Iterable<VariableState> variables = (List<VariableState>) AssociationCriteria.create(VariableState.class, getCurrentSession()) .add("valueTable", Operation.eq, valueTable.getValueTableState()) // .addSortingClauses(SortingClause.create("id")) // .getCriteria() .setFetchMode("categories", FetchMode.JOIN) .list(); for (VariableState v : variables) { sources.add(createSource(v)); } return sources; }
private Session getCurrentSession() { return valueTable.getDatasource().getSessionFactory().getCurrentSession(); }