My MySql数据库区分大小写,在休眠状态下一切正常,数据库中的表名与我的类相同。但是在Spring Security中,默认身份验证不能正常工作,用小写字母而不是大写字母来构建表名第一个字母的SQL。有没有什么办法让Spring的安全性像Hibernate那样理解大写?或者我是否需要构建自定义身份验证才能将表名更改为大写字母?春季安全区分大小写
<!-- Session Factory Hibernate -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="packagesToScan" value="br.com.empresa.domain" />
<property name="dataSource">
<ref local="mySQLdataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">create-drop</prop>
<!-- Novos geradores de ids recomendados pela documentação do hibernate -->
<prop key="hibernate.id.new_generator_mappings">false</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!-- Conexão com o Banco de Dados -->
<bean id="mySQLdataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/db" /> -->
<property name="username" value="root" />
<property name="password" value="asd123456" />
</bean>
<!-- It is responsible for validating the user's credentials -->
<security:authentication-manager>
<!-- It is responsible for providing credential validation to the AuthenticationManager -->
<security:authentication-provider>
<security:password-encoder ref="passwordEncoder" />
<security:jdbc-user-service
data-source-ref="mySQLdataSource" />
</security:authentication-provider>
</security:authentication-manager>
<bean
class="org.springframework.security.crypto.password.StandardPasswordEncoder"
id="passwordEncoder" />
spring安全访问数据库如何?你是如何配置的? – Kent
@Kent添加了我的配置 – raonirenosto