19 package org.turro.member.db.entities;
21 import java.io.Serializable;
22 import javax.persistence.Entity;
23 import javax.persistence.Id;
24 import javax.persistence.IdClass;
25 import org.turro.alliance.service.AxConstants;
26 import org.turro.alliance.service.AxServer;
27 import org.turro.jpa.entity.IDaoEntity;
28 import org.turro.json.Jsons;
29 import org.turro.json.Structure;
30 import org.turro.math.Zero;
31 import org.turro.string.Strings;
32 import org.turro.students.db.StudentsPU;
33 import org.turro.students.entities.Challenge;
34 import org.turro.ws.WsServer;
35 import org.turro.ws.service.member.Servers;
45 @Id
private String serverDomain;
46 @Id
private String challengeId;
48 private Long categoryId;
55 this.serverDomain = serverDomain;
63 this.challengeId = challengeId;
71 this.categoryId = categoryId;
79 return Strings.isBlank(challengeId) ? null :
80 (challenge ==
null ?
new StudentsPU().find(
Challenge.class, Long.valueOf(challengeId)) : challenge);
84 this.challenge = challenge;
85 this.challengeId = challenge ==
null ? null : Long.toString(challenge.
getId());
88 private transient Structure category;
93 Jsons.object().add(
"id", categoryId)).getStructure() : category);
97 this.category = category;
98 this.categoryId = category ==
null ? null : category.getLong(
"categoryId");
110 return Strings.isBlank(serverDomain) ||
111 Strings.isBlank(challengeId) ||
static final String SERVER_SERVICE
static boolean orNull(Number value)
static AxChallengeCategoryPK from(AxChallengeCategory pc)
void setServerDomain(String serverDomain)
void setChallengeId(String challengeId)
void setCategoryId(Long categoryId)
void setCategory(Structure category)
void setChallenge(Challenge challenge)
static WsServer from(String serverDomain, String service)