Jean-Francois Leveque

Pas de NamedQuery

......@@ -6,89 +6,6 @@ import java.util.*;
//import org.roliste.data.DbMaskableEntity;
//import org.roliste.data.DbValidationEntity;
@NamedQueries({
@NamedQuery(
name="findById",
query="SELECT u FROM User u WHERE u.userId=:id"
),
@NamedQuery(
name="listByPattern",
query="SELECT u FROM User u WHERE lower(u.username) LIKE :pattern or lower(u.email) LIKE :pattern or lower(u.firstName) LIKE :pattern or lower(u.lastName) LIKE :pattern or lower(u.nickname) LIKE :pattern ORDER BY u.userId DESC"
),
@NamedQuery(
name="listVisibleByPattern",
query="SELECT u FROM User u WHERE u.visible = true AND u.activated = true AND (lower(u.username) LIKE :pattern or lower(u.email) LIKE :pattern)"
),
@NamedQuery(
name="findByUsername",
query="SELECT u FROM User u WHERE u.username=:username"
),
@NamedQuery(
name="findByEmail",
query="SELECT u FROM User u WHERE u.email=:email"
),
/* TODO Régler le problème avec elements
@NamedQuery(
name="listByRolename",
query="SELECT u FROM User u, UserRole r WHERE r in elements(u.roles) AND r.rolename=:rolename AND u.visible is true AND u.activated is true"
),
*/
@NamedQuery(
name="listForEmailSend",
query="SELECT u FROM User u WHERE u.visible = true AND u.activated = true"
),
@NamedQuery(
name="listWithExactUserName",
query="SELECT u FROM User u WHERE u.visible = true AND u.activated = true AND u.username in (:usernames)"
),
@NamedQuery(
name="listVisibleCriticsProviders",
query="SELECT u FROM User u WHERE u.visible = true AND u.activated = true AND u.criticProvider = true"
),
/* TODO Régler le problème avec elements
@NamedQuery(
name="listPublisherDelegationsByUser",
query="SELECT p FROM Publisher p, User u WHERE u=:user AND p.traceable IN ELEMENTS(u.delegations) ORDER BY p.pubName"
),
*/
/* TODO Régler le problème avec elements
@NamedQuery(
name="listAuthorDelegationsByUser",
query="SELECT a FROM Author a, User u WHERE u=:user AND a.traceable IN ELEMENTS(u.delegations) ORDER BY a.lastName, a.firstName"
),
*/
/* TODO Régler le problème avec elements
@NamedQuery(
name="listPartnerDelegationsByUser",
query="SELECT p FROM Partner p, User u WHERE u=:user AND p.traceable IN ELEMENTS(u.delegations) ORDER BY p.name"
),
*/
/* TODO Régler le problème avec elements
@NamedQuery(
name="listIndieGameDelegationsByUser",
query="SELECT i FROM IndieGame i, User u WHERE u=:user AND i.traceable IN ELEMENTS(u.delegations) ORDER BY i.title"
),
*/
@NamedQuery(
name="listToCleanup",
query="SELECT u FROM User u WHERE u.activated = false AND u.creationDate < :limitDate"
),
@NamedQuery(
name="listAll",
query="SELECT u FROM User u ORDER BY u.userId"
)
/* TODO Pas de traceable pour l'instant, remplacé ou réutilisé ?
,
@NamedQuery(
name="userNotActivatedWithJournalisable",
query="SELECT u FROM Traceable t, User u WHERE t.creator = u.pk and u.activated = false"
),
@NamedQuery(
name="findByUrl",
query="SELECT u FROM User u WHERE u.traceable.urlRewrite=:url"
)
*/
})
// TODO Vérifier les extends
// TODO NameMask et DbMaskableEntity à traiter ensemble
@Entity
......