mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-30 16:52:13 +00:00
Add DEFAULT_USER_SCHEMA_DDL_LOCATION constant
Closes gh-10837
This commit is contained in:
parent
77ba94e1db
commit
c6b185465d
@ -110,6 +110,8 @@ import org.springframework.util.Assert;
|
|||||||
*/
|
*/
|
||||||
public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService, MessageSourceAware {
|
public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService, MessageSourceAware {
|
||||||
|
|
||||||
|
public static final String DEFAULT_USER_SCHEMA_DDL_LOCATION = "org/springframework/security/core/userdetails/jdbc/users.ddl";
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
public static final String DEF_USERS_BY_USERNAME_QUERY = "select username,password,enabled "
|
public static final String DEF_USERS_BY_USERNAME_QUERY = "select username,password,enabled "
|
||||||
+ "from users "
|
+ "from users "
|
||||||
|
@ -116,7 +116,7 @@ In our example, we will setup an https://docs.spring.io/spring-framework/docs/cu
|
|||||||
DataSource dataSource() {
|
DataSource dataSource() {
|
||||||
return new EmbeddedDatabaseBuilder()
|
return new EmbeddedDatabaseBuilder()
|
||||||
.setType(H2)
|
.setType(H2)
|
||||||
.addScript("classpath:org/springframework/security/core/userdetails/jdbc/users.ddl")
|
.addScript(JdbcDaoImpl.DEFAULT_USER_SCHEMA_DDL_LOCATION)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
@ -136,7 +136,7 @@ DataSource dataSource() {
|
|||||||
fun dataSource(): DataSource {
|
fun dataSource(): DataSource {
|
||||||
return EmbeddedDatabaseBuilder()
|
return EmbeddedDatabaseBuilder()
|
||||||
.setType(H2)
|
.setType(H2)
|
||||||
.addScript("classpath:org/springframework/security/core/userdetails/jdbc/users.ddl")
|
.addScript(JdbcDaoImpl.DEFAULT_USER_SCHEMA_DDL_LOCATION)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
Loading…
x
Reference in New Issue
Block a user