19 package org.turro.entities;
21 import java.util.List;
22 import org.turro.elephant.db.WhereClause;
23 import org.turro.jpa.Dao;
24 import org.turro.plugin.contacts.IContact;
25 import org.turro.students.db.StudentsPU;
26 import org.turro.students.entities.Challenge;
27 import org.turro.students.entities.Response;
41 wc.
addClause(
"select count(distinct c) from Challenge c");
42 wc.
addClause(
"where c.entityPath = :path");
53 wc.
addClause(
"select c from Challenge c");
54 wc.
addClause(
"where c.entityPath = :path");
65 wc.
addClause(
"select count(distinct c) from Challenge c");
66 wc.
addClause(
"where c.idChallenger = :idc");
77 wc.
addClause(
"select c from Challenge c");
78 wc.
addClause(
"where c.idChallenger = :idc");
89 wc.
addClause(
"select count(distinct r) from Response r");
90 wc.
addClause(
"where r.challenge.entityPath = :path");
101 wc.
addClause(
"select r from Response r");
102 wc.
addClause(
"where r.challenge.entityPath = :path");
113 wc.
addClause(
"select count(distinct r) from Response r");
114 wc.
addClause(
"where :idc member of r.studentIds");
125 wc.
addClause(
"select r from Response r");
126 wc.
addClause(
"where :idc member of r.studentIds");
133 wc.
addClause(
"select count(distinct r) from Response r");
134 wc.
addClause(
"where challenge.id = :idc");
141 wc.
addClause(
"select r from Response r");
142 wc.
addClause(
"where challenge.id = :idc");
144 return dao.getResultList(wc);
void addClause(String clause)
void addNamedValue(String name, Object value)
static IElephantEntity getController(String path)
static List< Response > getResponsesFrom(Dao dao, Challenge challenge)
static List< Challenge > getChallengesFrom(String idContact)
static long getResponseCountFromEntity(Object entity)
static long getChallengeCountFrom(String idContact)
static List< Response > getResponsesFromEntity(Object entity)
static List< Challenge > getChallengesFrom(IContact contact)
static long getResponseCountFromEntity(String entityPath)
static long getResponseCountFrom(String idContact)
static double getResponseCountFrom(Dao dao, Challenge challenge)
static List< Response > getResponsesFrom(IContact contact)
static List< Response > getResponsesFromEntity(String entityPath)
static long getChallengeCountFromEntity(Object entity)
static List< Challenge > getChallengesFromEntity(String entityPath)
static long getChallengeCountFromEntity(String entityPath)
static long getResponseCountFrom(IContact contact)
static List< Challenge > getChallengesFromEntity(Object entity)
static long getChallengeCountFrom(IContact contact)
static List< Response > getResponsesFrom(String idContact)
Object getSingleResult(WhereClause wc)