Class PersonDaoImpl
- java.lang.Object
-
- org.springframework.ldap.samples.plain.dao.PersonDaoImpl
-
- All Implemented Interfaces:
PersonDao
public class PersonDaoImpl extends java.lang.Object implements PersonDao
Default implementation of PersonDao. This implementation uses DirContextAdapter for managing attribute values. We 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. However, we do use it in one method that only needs a single attribute:getAllPersonNames()
.
-
-
Constructor Summary
Constructors Constructor Description PersonDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
create(Person person)
void
delete(Person person)
java.util.List<Person>
findAll()
Person
findByPrimaryKey(java.lang.String country, java.lang.String company, java.lang.String fullname)
java.util.List<java.lang.String>
getAllPersonNames()
void
setLdapTemplate(LdapTemplate ldapTemplate)
void
update(Person person)
-
-
-
Method Detail
-
getAllPersonNames
public java.util.List<java.lang.String> getAllPersonNames()
- Specified by:
getAllPersonNames
in interfacePersonDao
-
findByPrimaryKey
public Person findByPrimaryKey(java.lang.String country, java.lang.String company, java.lang.String fullname)
- Specified by:
findByPrimaryKey
in interfacePersonDao
-
setLdapTemplate
public void setLdapTemplate(LdapTemplate ldapTemplate)
-
-