Commit 7ef18bb4 authored by Matija Obreza's avatar Matija Obreza

AccessionList native querying fixed

parent c15634b1
......@@ -45,7 +45,7 @@ public class AccessionListRepositoryCustomImpl implements AccessionListCustomRep
@Override
public int addAll(AccessionList accessionList, Collection<Long> accessionIds) {
Query q = entityManager.createNativeQuery("insert ignore into accelistitems (listid, acceid) values (?1, ?2)");
Query q = entityManager.createNativeQuery("insert ignore into accession_listitem (listid, acceid) values (?1, ?2)");
q.setParameter(1, accessionList);
int count = 0;
for (Long acceId : accessionIds) {
......@@ -66,7 +66,7 @@ public class AccessionListRepositoryCustomImpl implements AccessionListCustomRep
});
directQuery.sort(new Sort("acceNumb"));
Query q = entityManager.createNativeQuery("insert ignore into accelistitems (listid, acceid) (" + directQuery.getQuery("?, a.id") + ")");
Query q = entityManager.createNativeQuery("insert ignore into accession_listitem (listid, acceid) (" + directQuery.getQuery("?, a.id") + ")");
q.setParameter(1, list.getId());
if (LOG.isDebugEnabled())
......@@ -82,7 +82,7 @@ public class AccessionListRepositoryCustomImpl implements AccessionListCustomRep
@Override
public int removeAll(AccessionList accessionList) {
Query q = entityManager.createNativeQuery("delete from accelistitems where listid = ?1");
Query q = entityManager.createNativeQuery("delete from accession_listitem where listid = ?1");
q.setParameter(1, accessionList);
return q.executeUpdate();
}
......
Markdown is supported
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