com.nkasenides.athlos.persistence.MultiDAO Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of athlos-core Show documentation
Show all versions of athlos-core Show documentation
An MMOG development framework.
package com.nkasenides.athlos.persistence;
import java.util.Collection;
import java.util.List;
/**
* Defines a Data Access Object pattern for use in DB transactions.
* @param The type of object being accessed.
*/
public interface MultiDAO extends DAO {
/**
* Retrieves an item based on its ID.
* @param id The ID of the item to retrieve.
* @return Returns a single object.
*/
T get(String id);
/**
* Retrieves many items based on their IDs.
* @param ids An array of string-based IDs.
* @return Returns a List of objects.
*/
Collection getMany(String... ids);
/**
* Retrieves all of the items of a particular type.
* @return Returns a collection of objects.
*/
Collection list();
/**
* Creates all of the given items in the database.
* @param objects An array of items to create.
* @return Returns true if the operation was successful, false otherwise.
*/
boolean create(Collection objects);
/**
* Updates all of the given items in the database.
* @param objects An array of items to update.
* @return Returns true if the operation was successful, false otherwise.
*/
boolean update(Collection objects);
/**
* Deletes all of the given items from the database.
* @param objects An array of items to delete.
* @return Returns true if the operation was successful, false otherwise.
*/
boolean delete(Collection objects);
}