19 package org.turro.security;
21 import java.util.List;
22 import java.util.Optional;
24 import org.turro.string.Strings;
25 import org.turro.contacts.db.ContactsPU;
26 import org.turro.elephant.db.WhereClause;
27 import org.turro.jpa.Dao;
38 wc.
addClause(
"select new org.turro.security.SecItem(s.name, count(s))");
41 if(!Strings.isBlank(value)) {
46 return new SecSet(dao.getResultList(wc, max));
52 wc.
addClause(
"select new org.turro.security.SecItem(s.name, count(s))");
56 return new SecSet(dao.getResultList(wc));
62 for(String sec : secNames) {
64 if(finalSet !=
null) {
65 finalSet.retainAll(
set);
70 return Optional.ofNullable(finalSet).orElseGet(() ->
SecSet.
empty());
75 wc.
addClause(
"select new org.turro.security.SecItem(s.name, count(s))");
77 wc.
addClause(
"join Syndication s1 on s.contact = s1.contact");
82 return new SecSet(dao.getResultList(wc));
87 wc.
addClause(
"select distinct s.contact.id from Syndication s");
92 wc.
addClause(
"select s.name from Syndication s2");
93 wc.
addClause(
"where s2.contact = s.contact");
94 wc.
addClause(
"and s2.name = :name" + count);
99 return dao.getResultList(String.class, wc);
104 wc.
addClause(
"delete from Syndication s");
void addClause(String clause)
void addLikeFields(String[] fields, String value)
void addNamedValue(String name, Object value)
int executeUpdate(String query)
static void removeSyndication(Dao dao, String syndication)
static SecSet search(String root, String value, int max)
static SecSet getSiblings(Set< String > secNames)
static SecSet getAvailables()
static List< String > getIdentifiers(Dao dao, Set< SecItem > sets)