Commit ffa23810 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Fixed JPA query

parent 0fef75d7
......@@ -131,7 +131,7 @@ public class JPAEventDAO extends AbstractDAO<Event> implements EventDAO {
public List<String> findCdsByChoreography(final String choreographyId) {
TypedQuery<String> query = entityManager().createQuery(
"SELECT e.artifactName FROM " + JPAEvent.class.getSimpleName()
+ " e WHERE e.choreographyInstance.choreography.id = :choreographyId"
+ " e WHERE e.choreographyInstance.choreographyId = :choreographyId"
+ " AND e.artifactType = :artifactType"
+ " GROUP BY e.artifactName",
String.class);
......@@ -144,7 +144,7 @@ public class JPAEventDAO extends AbstractDAO<Event> implements EventDAO {
public List<String> findServicesByChoreography(final String choreographyId) {
TypedQuery<String> query = entityManager().createQuery(
"SELECT e.artifactName FROM " + JPAEvent.class.getSimpleName()
+ " e WHERE e.choreographyInstance.choreography.id = :choreographyId"
+ " e WHERE e.choreographyInstance.choreographyId = :choreographyId"
+ " AND e.artifactType = :artifactType"
+ " GROUP BY e.artifactName",
String.class);
......@@ -158,7 +158,7 @@ public class JPAEventDAO extends AbstractDAO<Event> implements EventDAO {
public List<String> findChoreographyOperationsByArtifact(final String choreographyId, final String artifactName) {
TypedQuery<String> query = entityManager().createQuery(
"SELECT e.operationName FROM " + JPAEvent.class.getSimpleName()
+ " e WHERE e.choreographyInstance.choreography.id = :choreographyId"
+ " e WHERE e.choreographyInstance.choreographyId = :choreographyId"
+ " AND e.artifactName = :artifactName"
+ " GROUP BY e.operationName",
String.class);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment