fix
git-svn-id: svn://svn.dsv.su.se/scipro/scipro/trunk@265 73ecded7-942e-4092-bab0-0e58ef0ee984
This commit is contained in:
parent
80d7bf9d1f
commit
0ec297d402
@ -3,7 +3,10 @@
|
||||
*/
|
||||
package se.su.dsv.scipro.data.dao.jpa;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
@ -12,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CommentThreadDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.CommentThread;
|
||||
import se.su.dsv.scipro.data.dataobjects.Project;
|
||||
import se.su.dsv.scipro.data.dataobjects.User;
|
||||
import se.su.dsv.scipro.data.enums.ProjectStatus;
|
||||
|
||||
@ -41,8 +45,14 @@ public class CommentThreadDaoJPAImp extends AbstractDaoJPAImp<CommentThread>
|
||||
TypedQuery<CommentThread> query = em.createQuery(q, CommentThread.class);
|
||||
query.setParameter("className", className);
|
||||
query.setParameter("classId", classId);
|
||||
|
||||
try {
|
||||
return query.getSingleResult();
|
||||
} catch (NoResultException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
return query.getSingleResult();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user