org.jtheque.primary.dao.impl
Class DaoPersons

java.lang.Object
  extended by org.jtheque.core.managers.persistence.GenericDao<Person>
      extended by org.jtheque.primary.dao.impl.DaoPersons
All Implemented Interfaces:
org.jtheque.core.managers.persistence.able.JThequeDao, IDaoPersons

public final class DaoPersons
extends org.jtheque.core.managers.persistence.GenericDao<Person>
implements IDaoPersons

A Data Access Object implementation for borrowers.

Author:
Baptiste Wicht

Field Summary
 
Fields inherited from interface org.jtheque.primary.dao.able.IDaoPersons
TABLE
 
Constructor Summary
DaoPersons()
          Construct a new DaoBorrowers.
 
Method Summary
 void clearAll(String type)
          Clear all the entities with the specified type.
 Person createPerson()
          Create a person.
 boolean exist(Person person)
          Indicate if the person exist in the Dao.
 boolean exists(String firstName, String name, String type)
          Indicate if a person with this firstName and this name exists in the application.
 Person getPerson(int id)
          Return the person of the specified id.
 Person getPerson(String firstName, String name, String type)
          Return the person with the specified name and first name.
 Collection<Person> getPersons(String type)
          Return all the persons.
protected  org.jtheque.core.managers.persistence.QueryMapper getQueryMapper()
           
protected  org.springframework.jdbc.core.simple.ParameterizedRowMapper<Person> getRowMapper()
           
protected  void load(int i)
           
protected  void loadCache()
           
 
Methods inherited from class org.jtheque.core.managers.persistence.GenericDao
addDataListener, clearAll, create, delete, delete, get, getAll, getCache, isNotInCache, load, removeDataListener, save, setCacheEntirelyLoaded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jtheque.primary.dao.able.IDaoPersons
create, delete, save
 
Methods inherited from interface org.jtheque.core.managers.persistence.able.JThequeDao
addDataListener, clearAll, removeDataListener
 

Constructor Detail

DaoPersons

public DaoPersons()
Construct a new DaoBorrowers.

Method Detail

getPersons

public Collection<Person> getPersons(String type)
Description copied from interface: IDaoPersons
Return all the persons.

Specified by:
getPersons in interface IDaoPersons
Parameters:
type - The type of persons to search for.
Returns:
All the persons.

getPerson

public Person getPerson(int id)
Description copied from interface: IDaoPersons
Return the person of the specified id.

Specified by:
getPerson in interface IDaoPersons
Parameters:
id - The person borrower id.
Returns:
The person corresponding the id or null if there is no person with this id.

getPerson

public Person getPerson(String firstName,
                        String name,
                        String type)
Description copied from interface: IDaoPersons
Return the person with the specified name and first name.

Specified by:
getPerson in interface IDaoPersons
Parameters:
firstName - The searched first name.
name - The searched name.
type - The type of persons to search for.
Returns:
The person if there is no for this arguments else null.

exists

public boolean exists(String firstName,
                      String name,
                      String type)
Description copied from interface: IDaoPersons
Indicate if a person with this firstName and this name exists in the application.

Specified by:
exists in interface IDaoPersons
Parameters:
firstName - The searched first name.
name - The searched name.
type - The type of persons to search for.
Returns:
true if an person exist with first name and this name else false.

exist

public boolean exist(Person person)
Description copied from interface: IDaoPersons
Indicate if the person exist in the Dao.

Specified by:
exist in interface IDaoPersons
Parameters:
person - The person we must test if it's exist.
Returns:
true if the person exists else false.

createPerson

public Person createPerson()
Description copied from interface: IDaoPersons
Create a person.

Specified by:
createPerson in interface IDaoPersons
Returns:
A created empty person.

clearAll

public void clearAll(String type)
Description copied from interface: IDaoPersons
Clear all the entities with the specified type.

Specified by:
clearAll in interface IDaoPersons
Parameters:
type - The type of entities to delete.

loadCache

protected void loadCache()
Specified by:
loadCache in class org.jtheque.core.managers.persistence.GenericDao<Person>

load

protected void load(int i)
Specified by:
load in class org.jtheque.core.managers.persistence.GenericDao<Person>

getRowMapper

protected org.springframework.jdbc.core.simple.ParameterizedRowMapper<Person> getRowMapper()
Specified by:
getRowMapper in class org.jtheque.core.managers.persistence.GenericDao<Person>

getQueryMapper

protected org.jtheque.core.managers.persistence.QueryMapper getQueryMapper()
Specified by:
getQueryMapper in class org.jtheque.core.managers.persistence.GenericDao<Person>


Copyright © 2010 JTheque. All Rights Reserved.