ru.sstu.dao
Class EnumDao<T extends Serializable>

java.lang.Object
  extended by ru.sstu.dao.EnumDao<T>
Type Parameters:
T - concrete entity class
All Implemented Interfaces:
ReadOnlyDao<T>

public abstract class EnumDao<T extends Serializable>
extends Object
implements ReadOnlyDao<T>

EnumDao class is most common DAO for enumerations. It relies on object id is its number (beginning with 0) in enumeration.

Since:
DAO 1.0
Author:
Denis_Murashev

Constructor Summary
EnumDao()
           
 
Method Summary
 List<T> find()
          Provides all entities in the system.
abstract  T[] findAll()
          Provides array of all objects in enumeration.
 T findById(Serializable id)
          Provides entity with given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumDao

public EnumDao()
Method Detail

find

public List<T> find()
Provides all entities in the system.

Specified by:
find in interface ReadOnlyDao<T extends Serializable>
Returns:
list of entities

findById

public T findById(Serializable id)
Provides entity with given id.

Specified by:
findById in interface ReadOnlyDao<T extends Serializable>
Parameters:
id - entity id
Returns:
entity

findAll

public abstract T[] findAll()
Provides array of all objects in enumeration.

Returns:
array of all objects


Copyright © 2011 TFI branch of Engels Instutute of Technology. All Rights Reserved.