org.springframework.ldap.samples.person.dao
Class PersonDaoImpl
java.lang.Object
org.springframework.ldap.samples.person.dao.PersonDaoImpl
- All Implemented Interfaces:
- PersonDao
public class PersonDaoImpl
- extends Object
- implements PersonDao
Default implementation of PersonDao. This implementation uses
DirContextOperations (DirContextAdapter really, but for mock testing purposes
we use the interface) for managing attribute values. It has been specified in
the Spring Context that the DirObjectFactory should be used when creating
objects from contexts, which defaults to creating DirContextAdapter objects.
This means that we can use a ContextMapper to map from the found contexts to
our domain objects. This is especially useful since we in this case have
properties in our domain objects that depend on parts of the DN.
We could have worked with Attributes and an AttributesMapper implementation
instead, but working with Attributes is a bore and also, working with
AttributesMapper objects (or, indeed Attributes) does not give us access to
the distinguished name.
- Author:
- Mattias Arthursson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PersonDaoImpl
public PersonDaoImpl()
create
public void create(Person person)
- Specified by:
create
in interface PersonDao
update
public void update(Person person)
- Specified by:
update
in interface PersonDao
delete
public void delete(Person person)
- Specified by:
delete
in interface PersonDao
findAll
public List findAll()
- Specified by:
findAll
in interface PersonDao
findByPrimaryKeyData
public Person findByPrimaryKeyData(String country,
String company,
String fullname)
- Specified by:
findByPrimaryKeyData
in interface PersonDao
findByPrimaryKey
public Person findByPrimaryKey(String dn)
- Specified by:
findByPrimaryKey
in interface PersonDao
find
public List find(SearchCriteria criteria)
- Specified by:
find
in interface PersonDao
setLdapOperations
public void setLdapOperations(LdapOperations ldapOperations)
Copyright © 2006-2009 Spring Framework. All Rights Reserved.