Anyframe Core

anyframe.core.basis.dao
Interface GenericDao<T,PK extends Serializable>

Type Parameters:
T - a type variable
PK - the primary key for that type
All Known Implementing Classes:
GenericDaoHibernate, GenericDaoQuery

public interface GenericDao<T,PK extends Serializable>

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, modified by SooYeon Park

Method Summary
 boolean exists(PK id)
          Checks for existence of an object of type T using the id arg.
 T get(PK id)
          Generic method to get an object based on class and identifier.
 Page getList(SearchVO searchVO)
          Generic method to get object list based on search condition and search keyword
 void remove(PK id)
          Generic method to delete an object based on class and id
 T save(T object)
          Generic method to save an object - handles both update and insert.
 

Method Detail

get

T get(PK id)
      throws Exception
Generic method to get an object based on class and identifier. An ObjectRetrievalFailureException Runtime Exception is thrown if nothing is found.

Parameters:
id - the identifier (primary key) of the object to get
Returns:
a populated object
Throws:
Exception
See Also:
ObjectRetrievalFailureException

exists

boolean exists(PK id)
               throws Exception
Checks for existence of an object of type T using the id arg.

Parameters:
id - the id of the entity
Returns:
- true if it exists, false if it doesn't
Throws:
Exception

save

T save(T object)
       throws Exception
Generic method to save an object - handles both update and insert.

Parameters:
object - the object to save
Returns:
the persisted object
Throws:
Exception

remove

void remove(PK id)
            throws Exception
Generic method to delete an object based on class and id

Parameters:
id - the identifier (primary key) of the object to remove
Throws:
Exception

getList

Page getList(SearchVO searchVO)
             throws Exception
Generic method to get object list based on search condition and search keyword

Parameters:
searchVO - search condition and search keyword
Throws:
Exception

Anyframe Core

Copyright © 2008-2009 Samsung SDS. All Rights Reserved.