19 package org.turro.alliance.provider;
21 import java.util.List;
22 import org.turro.alliance.db.AlliancePU;
23 import org.turro.alliance.db.entities.RelationId;
24 import org.turro.jpa.Dao;
25 import org.turro.server.db.entities.AxProjectBan;
26 import org.turro.sql.SqlClause;
27 import org.turro.util.Cached;
28 import org.turro.ws.WsMember;
37 return SqlClause.select(
"b").from(
"AxProjectBan b")
38 .where().equal(
"b.relation.relatedMemberId", member.
getMemberId())
39 .and().isTrue(
"b.banned")
47 AxProjectBan ban = SqlClause.select(
"b").from(
"AxProjectBan b")
48 .where().equal(
"b.relation.relatedMemberId", member.
getMemberId())
49 .and().equal(
"id", axId)
52 return ban !=
null ? ban.
isBanned() :
false;
56 AxProjectBan ban = SqlClause.select(
"b").from(
"AxProjectBan b")
57 .where().equal(
"b.relation.relatedMemberId", member.
getMemberId())
58 .and().equal(
"id", axId)
71 ban = dao.get().saveObject(ban);
77 private final Cached<Dao> dao = Cached.instance(() ->
new AlliancePU());
void setRelatedMemberId(Long relatedMemberId)
void setRelatedEntityId(String relatedEntityId)
boolean toggle(String axId)
boolean status(String axId)
List< String > getBannedIds()
static Banned of(WsMember member)
void setRelation(RelationId relation)
void setBanned(boolean banned)