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

br.com.jhonsapp.bootstrap.object.persistence.generic.GenericDAO Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package br.com.jhonsapp.bootstrap.object.persistence.generic;

import br.com.jhonsapp.bootstrap.object.domain.generic.DomainObject;

/**
 * 
 * @author Jhonathan Camacho
 *
 * @param 
 *            any object that extends {@link DomainObject}
 * 
 * @see DomainObject
 */
public interface GenericDAO {
	/**
	 * Persist the object in the database.
	 * 
	 * @param object
	 *            the object to be persisted.
	 * @return true if the object was persisted. Return false otherwise.
	 */
	public boolean persist(T object);

	/**
	 * Update the object in the database.
	 * 
	 * @param object
	 *            the object to be updated.
	 * @return the updated object.
	 */
	public T update(T object);

	/**
	 * Remove the object from the database.
	 * 
	 * @param object
	 *            the object to be removed from the databse.
	 * @return true if the object was removed. Return false otherwise.
	 */
	public boolean remove(T object);

	/**
	 * Find an object by object's id.
	 * 
	 * @param id
	 *            the object's id.
	 * @return the object that have the informed id. Return null if there is no
	 *         object with the informed id.
	 */
	public T findById(long id);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy