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

org.appfuse.dao.GenericDao Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package org.appfuse.dao;

import java.io.Serializable;
import java.util.List;


/**
 * Generic DAO (Data Access Object) with common methods to CRUD POJOs.
 *
 * 

Extend this interface if you want typesafe (no casting necessary) DAO's for your * domain objects. * * @author Bryan Noll */ public interface GenericDao { /** * Generic method used to get all objects of a particular type. This * is the same as lookup up all rows in a table. * @return List of populated objects */ public List getAll(); /** * Generic method to get an object based on class and identifier. An * ObjectRetrievalFailureException Runtime Exception is thrown if * nothing is found. * * @param id the identifier (primary key) of the object to get * @return a populated object * @see org.springframework.orm.ObjectRetrievalFailureException */ public T get(PK id); /** * Generic method to save an object - handles both update and insert. * @param object the object to save */ public void save(T object); /** * Generic method to delete an object based on class and id * @param id the identifier (primary key) of the object to remove */ public void remove(PK id); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy