19 package org.turro.alliance.provider;
21 import org.turro.alliance.db.AlliancePU;
22 import org.turro.alliance.db.entities.AxCategory;
23 import org.turro.jpa.Dao;
24 import org.turro.json.Jsons;
25 import org.turro.sql.SqlClause;
26 import org.turro.util.Cached;
27 import org.turro.ws.WsMember;
28 import org.turro.ws.content.JsonServerProvider;
37 super(member, reason, criteria);
42 Jsons categories = Jsons.array();
43 SqlClause.select(
"p").from(
"AxCategory p")
45 .resultList(
AxCategory.class).forEach(category -> {
46 categories.addValue(Jsons.read(category.toJson()));
53 return SqlClause.select(
"count(p)").from(
"AxCategory p")
55 .singleResult(Long.class, 0L);
58 private final Cached<Dao> dao = Cached.instance(() ->
new AlliancePU());
long count(WsMember member, String reason, Jsons criteria)
CategoryProvider(WsMember member, String reason, Jsons criteria)
Jsons loadData(WsMember member, String reason, Jsons criteria)