It seems like maybe there are two separate questions here: 1) Should you be using hibernate at all and 2) How do you integrate your schema with spring security.
1) This is really an application choice, I wouldn't tie it to Spring. How big of an app will this be, how comfortable are you with hibernate, etc. If you've already chosen to use hibernate, yes you can certainly integrate it with Spring security (read on).
2) I would not "link" your user table to the Spring security user table. I would make them the same table. If you want to try this first with jdbc and then move to hibernate, you can. Here's how to use jdbc and customize the query to your liking to use your own table:
Code:
<beans:bean id="myUserDetailsService"
class="org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl">
<beans:property name="dataSource" ref="dataSource"/>
<beans:property name="usersByUsernameQuery" value="select username,password,enabled from user where username = ?"/>
<beans:property name="authoritiesByUsernameQuery" value="select username,authority from authorities where username = ?"/>
</beans:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider user-service-ref='myUserDetailsService'>
<password-encoder hash="sha-256" />
</authentication-provider>
</authentication-manager>
JdbcDaoImpl only requires that the returned column names match what it expects. So you can select from a table name of your choosing, column names of your choosing as well, and just map them to the right names e.g. "select user_name as username, ..."
Also I noticed there was no encoder in the xml snippet you posted. That would suggest you were storing the passwords in plain text. The snippet above turns them into a 1-way hash instead.
If/when you want to move to hibernate, you can implement the UserDetailsService interface and return an implementation of UserDetails. Then use your bean in the config in place of "myUserDetailsService". Here's a snippet, where UserAccount and Authority are both hibernate-mapped objects:
Code:
UserAccount user = <look up the user account>
Set<GrantedAuthority> grantedAuthorities = new HashSet<GrantedAuthority>(user.getAuthorities().size());
for (Authority authority : user.getAuthorities()) {
grantedAuthorities.add(new SimpleGrantedAuthority(authority.getAuthority()));
}
return new User(user.getUsername(), user.getPassword(), grantedAuthorities);