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

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

There is a newer version: 1.4.3
Show newest version
package org.neogroup.warp.resources;

import org.neogroup.warp.data.DataObject;
import org.neogroup.warp.data.query.DeleteQuery;
import org.neogroup.warp.data.query.InsertQuery;
import org.neogroup.warp.data.query.SelectQuery;
import org.neogroup.warp.data.query.UpdateQuery;

import java.util.Collection;

import static org.neogroup.warp.Warp.getConnection;

public class DataResource extends Resource {

    @Override
    public Collection find(SelectQuery query) {
        return getConnection().query(query);
    }

    @Override
    public Collection insert(InsertQuery query) {
        getConnection().execute(query);
        return null;
    }

    @Override
    public Collection update(UpdateQuery query) {
        getConnection().execute(query);
        return null;
    }

    @Override
    public Collection delete(DeleteQuery query) {
        getConnection().execute(query);
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy