0
我在應用程序中不斷收到一個連接到託管SQL Server 2008的'無效對象名'。我可以使用字符串從應用程序查詢數據庫。然而每當我使用Hibernate我得到這個錯誤無效的對象名稱hiberate 3.6
//Calling Class
SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
Transaction tx = session.beginTransaction();
session.save(survey);
tx.commit(); <!--Blows up-->
session.close();
<hibernate-configuration>
<session-factory name="Persist">
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.password">xxxx</property>
<property name="hibernate.connection.url">jdbc:sqlserver://xxxx</property>
<property name="hibernate.connection.username">xxxx</property>
<property name="hibernate.default_catalog">xxxx</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServer2008Dialect</property>
<mapping class="com.springmvc.dao.Survey" resource="com/springmvc/dao/Survey.hbm.xml"/>
</session-factory>
</hibernate-configuration>
//Table Mapping
<hibernate-mapping>
<class name="com.springmvc.dao.Survey" table="Survey">
<id name="SurveyId" type="int">
<column name="SURVEYID" />
<generator class="assigned" />
</id>
<property name="SurveyName" type="java.lang.String">
<column name="SURVEYNAME" />
</property>
<property name="CreateDate" type="java.sql.Date">
<column name="CREATEDATE" />
</property>
<property name="IsActive" type="boolean">
<column name="ISACTIVE" />
</property>
</class>
</hibernate-mapping>
//The Error
org.hibernate.exception.SQLGrammarException: could not insert: [com.springmvc.dao.Survey]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Recruiter.Survey'.
任何一個可以告訴我是怎麼回事,如何解決這個問題,它必須是一個Hibernate問題。我試圖添加一個計劃,然後我得到一個錯誤,說Recruiter.dbo.Survey是不允許的。沒有更多的配置文件可以查看,並且Google爲我提供了任何有用的東西。謝謝