Case sensitive on restrictions 'equals id' in Hibernate restrictions

后端 未结 2 889
忘掉有多难
忘掉有多难 2021-01-24 09:34

I try to do a case sensitive equals on username with Hibernate (3.6.9) but it seems that the restriction is case insensitive.
For example: \"AdMin\" or \"admin\

2条回答
  •  误落风尘
    2021-01-24 10:27

    I think you need to change table definition. In case of Mysqsl you need to alter your username column to binary or varbinary instead of char/varchar (http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html). For SQLServer, make sure username uses case-sensitive collation (see list of sql collations)

提交回复
热议问题