Java Reference
In-Depth Information
<bean id="authenticationDao"
<property name="dataSource" ref="dataSource"/>
<property name="userByUserNameQuery" >
SELECT username, password, enabled
FROM users
WHERE username=?
<property name="authoritiesByUserNameQuery" >
SELECT username, authority
FROM authorities
WHERE username=?
If your tables and column names were different, it is possible to supply your custom
queries by overriding the userByUserNameQuery and authoritiesByUserNameQuery properties.
You need to use proper aliases for the columns that have different names than the default
tables because Spring retrieves data from the resultset using default column names.
eInsure used the e-mail address instead of the username and role in the place of author-
ity. Listing 6-12 shows the configuration of the custom queries with aliases.
Listing 6-12. applicationContext-security.xml
<?xml version="1.0" encoding="UTF-8"?>
Search WWH ::

Custom Search