有关hibernate异常汇总

一 异常说:table_name is not mapped;

    原因:在写的hql语句中不应该写table的名字,而是写POJO类名.

     Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute update query
 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
 at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:84)
 at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:326)
 at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:202)
 at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1111)
 at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
 at com.ycw.listhibernate.Test.main(Test.java:21)
Caused by: java.sql.SQLException: ORA-00942: 表或视图不存在

 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:212)
 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:951)
 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
 at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3367)
 at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:75)
 ... 5 more

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值