0
我想從我的PostgreSQL數據庫獲取所有的電影列表如下:的PostgreSQL與NHibernate(.NET,pgsql的)查詢錯誤
IQuery query = session.CreateQuery("FROM Movie");
,但得到這個錯誤:錯誤:42P01:關係「的電影「不存在
這裏是我在pgAdminIII使用效果
SELECT
"Movies"."Id",
"Movies"."Title",
"Movies"."Director",
"Movies"."ReleaseDate"
FROM
public."Movies";
它看起來像查詢不正確正從NHibernate的內置的查詢。這是web.config設置。
<configSections>
<section name="hibernate-configuration" requirePermission="false" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="NHibernate.Test">
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property>
<property name="connection.connection_string">Server=localhost;database=Movies;User ID=movie;Password=password;</property>
<property name="dialect">NHibernate.Dialect.PostgreSQLDialect</property>
<property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
</session-factory>
</hibernate-configuration>
任何想法?
如果您需要保留混合大小寫名稱,請在反引號('')中包含對象名稱。 – 2010-11-11 19:43:10
Backtics?這是MySQL的東西,並不適用於任何其他數據庫。如果需要,可以使用ANSI-SQL雙引號,就像上面的例子一樣。 – 2010-11-11 20:08:12