br.com.jhonsapp.bootstrap.object.persistence.generic.GenericDAO Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bootstrap-object Show documentation
Show all versions of bootstrap-object Show documentation
A complete architecture for creating and managing users.
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);
}