原则列名称区分大小写 [英] Doctrine column names case sensitivity

查看:170
本文介绍了原则列名称区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用Doctrine查询mssql数据库。我设置了连接,从数据库和构建的类构建模式。一切顺利,但现在当我尝试查询数据库时:

I'm trying to query mssql database with Doctrine. I set up connection, built schema from database and built classes. All went smoothly, but now when I try to query database:

symfony doctrine:dql "from TABLE_NAME"

我收到错误列名column_name无效,因为我们的mssql数据库服务器设置为使用CASE SENSITIVE和UPPER CASE列名称,而教义强迫我的所有列名称都是小写。如何设定原则以保持敏感性(更好)或使其成为大写?

I get an error Invalid column name 'column_name', because our mssql database server is setup to use CASE SENSITIVE and UPPER CASE column names, whereas doctrine is forcing all my column names to be lower case. How do I set up doctrine to either preserve sensitivity (better) or make them upper case?

推荐答案

查看链接

http://www.doctrine-project.org/projects/orm/1.2/docs / manual / configuration / en

$conn->setAttribute(Doctrine_Core::ATTR_PORTABILITY,
        Doctrine_Core::PORTABILITY_FIX_CASE )

这篇关于原则列名称区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆