org.figure8.join.businessobjects.security.persistence
Class JdbcUserDao

java.lang.Object
  extended by org.figure8.join.businessobjects.security.persistence.JdbcUserDao
All Implemented Interfaces:
UserDao, ObjectDao

public class JdbcUserDao
extends java.lang.Object
implements UserDao

This is an implementation of UserDao using row Jdbc.

Version:
$Revision: 1.2 $
Author:
Jerome Evrard, Laurent Broudoux

Constructor Summary
JdbcUserDao()
          Creates a new instance of JdbcUserDao
 
Method Summary
 java.util.List findAll()
          Find all entity objects associated with this Dao.
 java.util.List findAllSorted(java.lang.String sortField)
          Find all entity objects asscoiated with this Dao.
protected  User findUser(long id)
          Find a unique User using its identifier
protected  User findUser(java.lang.String login)
          Find a unique User using its login
protected  java.util.List findUsers(java.lang.String criterionColumn, java.lang.String value, java.lang.String sortColumn)
          Find many users using a criterion column and its value.
 java.lang.String getFirstnameColumn()
           
 java.lang.String getIdColumn()
           
 java.lang.String getLastnameColumn()
           
 java.lang.String getLoginColumn()
           
 java.lang.String getMailColumn()
           
 java.lang.String getPasswordColumn()
           
 java.lang.Class getPersistentClass()
          Get the persistent class associated to this Dao.
 java.lang.String getPhoneColumn()
           
protected  java.lang.String getSelectClause()
          Retrieve the where clause depending on specified columns and table name
 java.lang.String getTeamColumn()
           
 User getUser(java.lang.String login)
           
protected  org.springframework.jdbc.core.RowMapper getUserRowMapper()
          Retrieve a Spring row mappper for User object
 java.util.List getUsersWithLastnameLike(java.lang.String lastname)
          Retrieve all users having lastname 'like' the specified one
 java.lang.String getUserTable()
           
 void initialize(EntityObject entityobject)
          Force initialization of the given entity from underlying datastore (this may involves initialization of lazily loaded relations fields)
 void initializeAssociation(EntityObject entityobject, java.lang.Object proxy)
          Force initialization of the given entity association from underlying datastore
 boolean isInitialized(java.lang.Object object)
          Check if an object (EntityObject or association proxy) is initialized from datastore
 void refresh(EntityObject entityobject)
          Re-read the content of the given entity from underlying datastore.
 void remove(EntityObject entityobject)
          Remove the given entity object from underlying datastore.
 void replicate(java.lang.Object obj)
          Persist the object state throughout the cluster.
 void save(EntityObject entityobject)
          Save the given entity into underlying datastore.
 void setDataSource(javax.sql.DataSource dataSource)
           
 void setFirstnameColumn(java.lang.String firstnameColumn)
           
 void setIdColumn(java.lang.String idColumn)
           
 void setLastnameColumn(java.lang.String lastnameColumn)
           
 void setLoginColumn(java.lang.String loginColumn)
           
 void setMailColumn(java.lang.String mailColumn)
           
 void setPasswordColumn(java.lang.String passwordColumn)
           
 void setPhoneColumn(java.lang.String phoneColumn)
           
 void setTeamColumn(java.lang.String teamColumn)
           
 void setUserTable(java.lang.String userTable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcUserDao

public JdbcUserDao()
Creates a new instance of JdbcUserDao

Method Detail

getIdColumn

public java.lang.String getIdColumn()
Returns:
Column representing unique identifier

setIdColumn

public void setIdColumn(java.lang.String idColumn)
Parameters:
idColumn - Column representing unique identifier

getLoginColumn

public java.lang.String getLoginColumn()
Returns:
Column representing user login

setLoginColumn

public void setLoginColumn(java.lang.String loginColumn)
Parameters:
loginColumn - Column representing user login

getPasswordColumn

public java.lang.String getPasswordColumn()
Returns:
Column representing user password

setPasswordColumn

public void setPasswordColumn(java.lang.String passwordColumn)
Parameters:
passwordColumn - Column representing user password

getLastnameColumn

public java.lang.String getLastnameColumn()
Returns:
Column representing user lastname

setLastnameColumn

public void setLastnameColumn(java.lang.String lastnameColumn)
Parameters:
lastnameColumn - Column representing user lastname

getFirstnameColumn

public java.lang.String getFirstnameColumn()
Returns:
Column representing user firstname

setFirstnameColumn

public void setFirstnameColumn(java.lang.String firstnameColumn)
Parameters:
firstnameColumn - Column representing user firstname

getMailColumn

public java.lang.String getMailColumn()
Returns:
Column representing user mail address

setMailColumn

public void setMailColumn(java.lang.String mailColumn)
Parameters:
mailColumn - Column representing user mail address

getPhoneColumn

public java.lang.String getPhoneColumn()
Returns:
Column representing user phone number

setPhoneColumn

public void setPhoneColumn(java.lang.String phoneColumn)
Parameters:
phoneColumn - Column representing user phone number

getTeamColumn

public java.lang.String getTeamColumn()
Returns:
Column representing user team description

setTeamColumn

public void setTeamColumn(java.lang.String teamColumn)
Parameters:
teamColumn - Column representing user team description

getUserTable

public java.lang.String getUserTable()
Returns:
Table containing user definitions

setUserTable

public void setUserTable(java.lang.String userTable)
Parameters:
userTable - Table containing user definitions

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)
Parameters:
dataSource - The Datasource allowing access to userTable

getUser

public User getUser(java.lang.String login)
Specified by:
getUser in interface UserDao
Parameters:
login - User login (should be a unique identifier)
Returns:
The user object corresponding to login

getUsersWithLastnameLike

public java.util.List getUsersWithLastnameLike(java.lang.String lastname)
Retrieve all users having lastname 'like' the specified one

Specified by:
getUsersWithLastnameLike in interface UserDao
Parameters:
lastname - The string that users lastname should contain
Returns:
A List of org.figure8.join.businessobjects.security.User

save

public void save(EntityObject entityobject)
Save the given entity into underlying datastore.

Specified by:
save in interface ObjectDao
Parameters:
entityobject - EntityObject to save

remove

public void remove(EntityObject entityobject)
Remove the given entity object from underlying datastore.

Specified by:
remove in interface ObjectDao
Parameters:
entityobject - EntityObject to remove

refresh

public void refresh(EntityObject entityobject)
Re-read the content of the given entity from underlying datastore.

Specified by:
refresh in interface ObjectDao
Parameters:
entityobject - EntityObject to refresh content

initialize

public void initialize(EntityObject entityobject)
Force initialization of the given entity from underlying datastore (this may involves initialization of lazily loaded relations fields)

Specified by:
initialize in interface ObjectDao
Parameters:
entityobject - EntityObject to initialize

initializeAssociation

public void initializeAssociation(EntityObject entityobject,
                                  java.lang.Object proxy)
Force initialization of the given entity association from underlying datastore

Specified by:
initializeAssociation in interface ObjectDao
Parameters:
entityobject - EntityObject whose association shoud be initialized
proxy - A proxy object representing entoty association (this may be a collection)

isInitialized

public boolean isInitialized(java.lang.Object object)
Check if an object (EntityObject or association proxy) is initialized from datastore

Specified by:
isInitialized in interface ObjectDao
Parameters:
object - The object to check initialization for
Returns:
true if object has been loaded from datastore, false otherwise

replicate

public void replicate(java.lang.Object obj)
Persist the object state throughout the cluster.

Specified by:
replicate in interface ObjectDao
Parameters:
obj - The object to replicate

findAll

public java.util.List findAll()
Find all entity objects associated with this Dao.

Specified by:
findAll in interface ObjectDao
Returns:
A List of EntityObjects

findAllSorted

public java.util.List findAllSorted(java.lang.String sortField)
Find all entity objects asscoiated with this Dao. The result list is sorted by sortField criteria.

Specified by:
findAllSorted in interface ObjectDao
Parameters:
sortField - Field for sorting criteria
Returns:
A List of EntityObjects

getPersistentClass

public java.lang.Class getPersistentClass()
Get the persistent class associated to this Dao.

Specified by:
getPersistentClass in interface ObjectDao
Returns:
The class of the persistent object

findUser

protected User findUser(long id)
Find a unique User using its identifier

Parameters:
id - The identifier of User to retrieve
Returns:
The corresponding User or null.

findUser

protected User findUser(java.lang.String login)
Find a unique User using its login

Parameters:
login - The login of User to retrieve
Returns:
The corresponding User object or null.

findUsers

protected java.util.List findUsers(java.lang.String criterionColumn,
                                   java.lang.String value,
                                   java.lang.String sortColumn)
Find many users using a criterion column and its value.

Parameters:
criterionColumn - The column that appears in where clause
value - The value of select criterion
sortColumn - The column to use for sorting results
Returns:
A list of User objects

getSelectClause

protected java.lang.String getSelectClause()
Retrieve the where clause depending on specified columns and table name

Returns:
The where clause of SQL query from 'select' to 'from table '

getUserRowMapper

protected org.springframework.jdbc.core.RowMapper getUserRowMapper()
Retrieve a Spring row mappper for User object

Returns:
A RowMapper implementation for User object


Copyright © 2005-2008 Join. All Rights Reserved.