第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

休眠表未映射但表存在

休眠表未映射但表存在

慕哥9229398 2021-05-07 18:16:34
我有一個(gè)使用Hibernate的項(xiàng)目,但有一個(gè)錯(cuò)誤表未映射。org.jboss.resteasy.spi.UnhandledException: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: TrainingRoom is not mapped [SELECT DISTINCT t FROM TrainingRoom t ORDER BY t.id]at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:77)at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:220)at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:175)...Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: TrainingRoom is not mapped [SELECT DISTINCT t FROM TrainingRoom t ORDER BY t.id]at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)...Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: TrainingRoom is not mapped [SELECT DISTINCT t FROM TrainingRoom t ORDER BY t.id]at org.hibernate.hql.internal.ast.QuerySyntaxException.generateQueryException(QuerySyntaxException.java:79)at org.hibernate.QueryException.wrapWithQueryString(QueryException.java:103)at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:218)...這是我的TrainingRoom.java@Entity@Table(name = "ppp_trainingRoom")public class TrainingRoom {    @Id    @GeneratedValue(strategy = GenerationType.TABLE)    @Column(name = "id", updatable = false, nullable = false)    private Long id;    @Column    private String roomName;    //GET SET Method}在遇到這個(gè)錯(cuò)誤之前,我有2個(gè)EntityManager,因?yàn)槲矣幸恍┩x詞表。但是我發(fā)現(xiàn)它不是必須的。所以我刪除了它,然后卡住了,就像上面的錯(cuò)誤一樣。我該如何解決?
查看完整描述

1 回答

?
有只小跳蛙

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超8個(gè)贊

您可以添加新屬性:

 <property name="hibernate.archive.autodetection" value="class" />

或者,您可以在持久性單元標(biāo)簽下為每個(gè)類(lèi)指定類(lèi)標(biāo)簽:

<class>org.cmh.itsetup.model.TrainingRoom</class>


查看完整回答
反對(duì) 回復(fù) 2021-05-19
  • 1 回答
  • 0 關(guān)注
  • 193 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)