org.neogroup.warp.resources.ResourceProxy Maven / Gradle / Ivy
package org.neogroup.warp.resources;
import org.neogroup.warp.data.query.QueryObject;
import java.util.Collection;
public class ResourceProxy extends QueryObject> {
private Resource resource;
public ResourceProxy(String resourceName, Resource resource) {
super(resourceName);
this.resource = resource;
}
public Collection find() {
return resource.find(createSelectQuery());
}
public Collection insert () {
return resource.insert(createInsertQuery());
}
public Collection update () {
return resource.update(createUpdateQuery());
}
public Collection delete () {
return resource.delete(createDeleteQuery());
}
public T first () {
return limit(1).find().iterator().next();
}
}