Upgraded backend api with generics.
This commit is contained in:
parent
9a6227be5b
commit
1b3e65fa83
53 changed files with 282 additions and 256 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package net.forwardfire.vasc.opt.editor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -27,14 +28,14 @@ import net.forwardfire.vasc.impl.DefaultVascEntryField;
|
|||
import net.forwardfire.vasc.impl.DefaultVascEntryFieldSet;
|
||||
import net.forwardfire.vasc.impl.DefaultVascEntryLink;
|
||||
|
||||
public class VirtualVascBackend extends AbstractVascBackend {
|
||||
public class VirtualVascBackend extends AbstractVascBackend<Serializable> {
|
||||
|
||||
private VascController vascController = null;
|
||||
private String vascType = "entry";
|
||||
private String entryId = null;
|
||||
|
||||
public List<Object> execute(VascBackendState state) throws VascBackendException {
|
||||
List<Object> result = new ArrayList<Object>(100);
|
||||
public List<Serializable> execute(VascBackendState state) throws VascBackendException {
|
||||
List<Serializable> result = new ArrayList<Serializable>(100);
|
||||
entryId = (String)state.getDataParameter("entry_id");
|
||||
if ("entry".equals(vascType)) {
|
||||
for (String id:vascController.getVascEntryController().getVascEntryIds()) {
|
||||
|
|
@ -65,19 +66,19 @@ public class VirtualVascBackend extends AbstractVascBackend {
|
|||
return result;
|
||||
}
|
||||
|
||||
public void persist(Object object) throws VascBackendException {
|
||||
public void persist(Serializable object) throws VascBackendException {
|
||||
edit(object,false,true);
|
||||
}
|
||||
|
||||
public Object merge(Object object) throws VascBackendException {
|
||||
public Serializable merge(Serializable object) throws VascBackendException {
|
||||
return edit(object,true,true);
|
||||
}
|
||||
|
||||
public void delete(Object object) throws VascBackendException {
|
||||
public void delete(Serializable object) throws VascBackendException {
|
||||
edit(object,true,false);
|
||||
}
|
||||
|
||||
public Object edit(Object object,boolean removeReal,boolean addEdit) throws VascBackendException {
|
||||
public Serializable edit(Serializable object,boolean removeReal,boolean addEdit) throws VascBackendException {
|
||||
|
||||
if (object instanceof VascEntry) {
|
||||
entryId = ((VascEntry)object).getId();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue