From 6b93e413b6dfaee62a64300d996d7dff20a11622 Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Mon, 3 Jun 2019 11:45:38 +0200 Subject: [PATCH] #321: remove duplicate contributors --- .../src/main/java/com/sismics/docs/core/dao/ContributorDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/ContributorDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/ContributorDao.java index 22e392a7..a0ae23b4 100644 --- a/docs-core/src/main/java/com/sismics/docs/core/dao/ContributorDao.java +++ b/docs-core/src/main/java/com/sismics/docs/core/dao/ContributorDao.java @@ -56,7 +56,7 @@ public class ContributorDao { @SuppressWarnings("unchecked") public List getByDocumentId(String documentId) { EntityManager em = ThreadLocalContext.get().getEntityManager(); - StringBuilder sb = new StringBuilder("select u.USE_USERNAME_C, u.USE_EMAIL_C from T_CONTRIBUTOR c "); + StringBuilder sb = new StringBuilder("select distinct u.USE_USERNAME_C, u.USE_EMAIL_C from T_CONTRIBUTOR c "); sb.append(" join T_USER u on u.USE_ID_C = c.CTR_IDUSER_C "); sb.append(" where c.CTR_IDDOC_C = :documentId "); Query q = em.createNativeQuery(sb.toString());