WIP added backend generics so all is seriazible and started to make
execute return full result.
This commit is contained in:
parent
3bf185ad48
commit
90b81deb29
25 changed files with 109 additions and 76 deletions
|
|
@ -23,9 +23,12 @@
|
|||
package net.forwardfire.vasc.backends.jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.forwardfire.vasc.backend.DefaultVascBackendResult;
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.backend.VascBackendResult;
|
||||
import net.forwardfire.vasc.backend.VascBackendState;
|
||||
import net.forwardfire.vasc.backend.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.backend.VascEntryRecordCreator;
|
||||
|
|
@ -74,7 +77,7 @@ public class XpqlHibernateVascBackend<DATA_OBJECT extends Serializable> extends
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<DATA_OBJECT> execute(VascBackendState state) throws VascBackendException {
|
||||
public VascBackendResult<DATA_OBJECT> execute(VascBackendState state) throws VascBackendException {
|
||||
|
||||
// Copy parameters
|
||||
for (String key:state.getDataParameterKeys()) {
|
||||
|
|
@ -106,7 +109,8 @@ public class XpqlHibernateVascBackend<DATA_OBJECT extends Serializable> extends
|
|||
}
|
||||
List<DATA_OBJECT> data = q.list();
|
||||
s.getTransaction().commit();
|
||||
return data;
|
||||
|
||||
return new DefaultVascBackendResult<DATA_OBJECT>(data);
|
||||
} finally {
|
||||
if (s!=null) {
|
||||
//em.close();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ import java.util.List;
|
|||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.Query;
|
||||
|
||||
import net.forwardfire.vasc.backend.DefaultVascBackendResult;
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.backend.VascBackendResult;
|
||||
import net.forwardfire.vasc.backend.VascBackendState;
|
||||
import net.forwardfire.vasc.backend.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.backend.VascEntryRecordCreator;
|
||||
|
|
@ -77,7 +79,7 @@ public class XpqlPersistanceVascBackend<DATA_OBJECT extends Serializable> extend
|
|||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<DATA_OBJECT> execute(VascBackendState state) throws VascBackendException {
|
||||
public VascBackendResult<DATA_OBJECT> execute(VascBackendState state) throws VascBackendException {
|
||||
|
||||
// Copy parameters
|
||||
for (String key:state.getDataParameterKeys()) {
|
||||
|
|
@ -111,7 +113,8 @@ public class XpqlPersistanceVascBackend<DATA_OBJECT extends Serializable> extend
|
|||
if (emTransaction) {
|
||||
em.getTransaction().commit();
|
||||
}
|
||||
return data;
|
||||
VascBackendResult<DATA_OBJECT> result = new DefaultVascBackendResult<DATA_OBJECT>(data);
|
||||
return result;
|
||||
} finally {
|
||||
if (em!=null) {
|
||||
//em.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue