fr.paris.lutece.plugins.userban.service
Class AbstractService<K,E extends AbstractBean<K>>

java.lang.Object
  extended by fr.paris.lutece.plugins.userban.service.AbstractService<K,E>
Type Parameters:
K - the bean primary key
E - the bean class
All Implemented Interfaces:
IAbstractService<K,E>
Direct Known Subclasses:
UserService

public abstract class AbstractService<K,E extends AbstractBean<K>>
extends Object
implements IAbstractService<K,E>

The abstract class service


Constructor Summary
AbstractService()
           
 
Method Summary
 void doDeleteBean(K id)
          Delete user in database
 void doSaveBean(E bean)
          Create or update user in database
 List<E> find(AbstractFilter<K> filter, PaginationProperties paginationProperties)
          Get all the bean matching the filter from dao
 List<E> findAll(PaginationProperties paginationProperties)
          Get all the bean from dao
 E findByPrimaryKey(K id)
          Find an entity by its Id
protected abstract  Class<E> getBeanClass()
          Get the class type of the bean
protected abstract  IAbstractDAO<K,E> getDAO()
          Get the bean dao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractService

public AbstractService()
Method Detail

getDAO

protected abstract IAbstractDAO<K,E> getDAO()
Get the bean dao

Returns:
the dao

getBeanClass

protected abstract Class<E> getBeanClass()
Get the class type of the bean

Returns:
the class type

findByPrimaryKey

public E findByPrimaryKey(K id)
Description copied from interface: IAbstractService
Find an entity by its Id

Specified by:
findByPrimaryKey in interface IAbstractService<K,E extends AbstractBean<K>>
Parameters:
id - The entity key
Returns:
The entity object

findAll

public List<E> findAll(PaginationProperties paginationProperties)
Description copied from interface: IAbstractService
Get all the bean from dao

Specified by:
findAll in interface IAbstractService<K,E extends AbstractBean<K>>
Parameters:
paginationProperties - the pagination properties
Returns:
the bean list

find

public List<E> find(AbstractFilter<K> filter,
                    PaginationProperties paginationProperties)
Description copied from interface: IAbstractService
Get all the bean matching the filter from dao

Specified by:
find in interface IAbstractService<K,E extends AbstractBean<K>>
Parameters:
filter - the filter
paginationProperties - the pagination properties
Returns:
the bean list

doSaveBean

public void doSaveBean(E bean)
Description copied from interface: IAbstractService
Create or update user in database

Specified by:
doSaveBean in interface IAbstractService<K,E extends AbstractBean<K>>
Parameters:
bean - the bean to save

doDeleteBean

public void doDeleteBean(K id)
Description copied from interface: IAbstractService
Delete user in database

Specified by:
doDeleteBean in interface IAbstractService<K,E extends AbstractBean<K>>
Parameters:
id - the bean to delete


Copyright © 2013 Mairie de Paris. All Rights Reserved.