Your best bet is probably to follow the instructions in the manual on using a UserDetailsContextMapper
with LDAP.
Since you want to call the database here, I would use a NullLdapAuthoritiesPolulator
and just load all the data, including the user roles, in your UserDetailsContextMapper
. That way you'll avoid having to make two database calls.