All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.neogroup.warp.resources.ResourceProxy Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy