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

org.schoellerfamily.gedbrowser.api.crud.ObjectCrud Maven / Gradle / Ivy

There is a newer version: 1.3.0-RC2
Show newest version
package org.schoellerfamily.gedbrowser.api.crud;

import java.util.List;

import org.schoellerfamily.gedbrowser.api.datamodel.ApiObject;

/**
 * @author Dick Scholler
 * @param  the type of object operated on
 */
public interface ObjectCrud  {
    /**
     * @param db the name of the db to access
     * @param object the data for the object
     * @return the object as created
     */
    Z createOne(String db, Z object);

    /**
     * @param db the dataset name
     * @return the list of API objects
     */
    List readAll(String db);

    /**
     * @param db the dataset name
     * @param id the ID of the object we want
     * @return the object
     */
    Z readOne(String db, String id);

    /**
     * @param db the dataset
     * @param id the ID of the thing to update
     * @param object the new data
     * @return the updated object
     */
    Z updateOne(String db, String id, Z object);

    /**
     * @param db the name of the db to access
     * @param id the ID of the object
     * @return the deleted object
     */
    Z deleteOne(String db, String id);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy