JPA+Hibernate架構上可以使用HQL嗎? 40C

我的項目的SQL語句原來是采用HQL的,現在轉用Spring Boot +JPA+Hibernate, 出現以下問題,我估計是因爲HQL與JPQL的差異所致,請問如果我想繼續用HQL可以嗎? 如果可以,如何配置?

請問我如何知道我在用HQL還是用JPQL呢,如果我在用JPQL,又如何改成用HQL呢?

  1. 代碼:
    @Entity
    public class Place extends Groupunit_Defined implements Interface_Entity
    {
    ......
    @ManyToOne(targetEntity=Place_Definer.class)
    @JoinColumn(name="Groupunit_Definer",nullable=false)
    private Place_Definer Groupunit_Definer;//

    .....
    }
    @Entity
    public class Place_Definer extends Groupunit_Definer
    {
    ......
    @Column(nullable=false,length=150)
    private String Classification;
    }

  2. SQL 語句
    "SELECT * FROM Place p WHERE p.Groupunit_Definer.Classification='Jurisdiction'"

3.hibernate 設置

spring.jpa.database = MYSQL
spring.jpa.show-sql = true
spring.jpa.hibernate.ddl-auto = update
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

4.報錯

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Unit_Quantityp.Groupunit_Definer..Classification in 'where clause'

5个回答

JPA是规范,Hibernate只是JPA的一个实现而已,肯定可以用HQL啊,你看下是不是Unit_Quantity.Id这里有问题,类名是不是正确,Id是不是应该写成id,HQL语句里面的字段用的java的属性名,而不是数据库的字段名。有问题可以追问,解决了你的问题,请采纳下谢谢!!!

Lei_Da_Gou
Lei_Da_Gou 回复yuehoiwai:应该是语句有错,你把where去掉试试看,没错就说明你的列名有问题
5 个月之前 回复
yuehoiwai
yuehoiwai 回复Lei_Da_Gou: 但是,在搬到現架構(java ee, spring boot...)之前代碼都是測試過的,運作良好的呀。
5 个月之前 回复
Lei_Da_Gou
Lei_Da_Gou 回复yuehoiwai: 看了你的评论,大概知道了,说白了你现在是不知道HQL语法和JPQL的语法,你花点时间把HQL和JPQL的语法学习下你就懂你用的是HQL还是JPQL了,改成HQL就按照HQL语句的语法改就行了。自己先学习HQL和JPQL语法你就懂了。
5 个月之前 回复
yuehoiwai
yuehoiwai 報錯修改了一下, 應爲“Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'p.Groupunit_Definer.Classification in 'where clause'”,請問我如何知道我在用HQL還是用JPQL呢,如果我在用JPQL,又如何改成用HQL呢?
5 个月之前 回复

HQL 是hibernate的查询语言。系统集成了hibernate就可以使用了。

错误信息是显示你的p.Groupunit_Definer.Classification 语句有问题。
是不是需要添加 left join fetch 这类语句。

yuehoiwai
yuehoiwai 謝謝,不過代碼在搬到現架構(java ee, spring boot...)之前代碼都是運作良好的呀。
5 个月之前 回复

JPA是对象-关系型映射的标准,说白了就是提供了一套接口,没有具体实现,而hibernate框架实现了这套接口。所以,说白了,即便添加了jpa,你依旧是使用着hql。
这里报错是你 p.Groupunit_Definer.Classification 这里显示未知。自己查一下自己这个地方为什么引用错误了

將EntityManager.createNativeQuery改成 EntityManager.createQuery,問題就解決了,謝謝大家。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JPA+Hibernate架構上可以使用HQL嗎?
我的項目的SQL語句原來是采用HQL的,現在轉用Spring Boot +JPA+Hibernate, 出現以下問題,我估計是因爲HQL與JPQL的差異所致,請問如果我想繼續用HQL可以嗎? 如果可以,如何配置? 請問我如何知道我在用HQL還是用JPQL呢,如果我在用JPQL,又如何改成用HQL呢? 1. 代碼: @Entity public class Place extends Groupunit_Defined implements Interface_Entity { ...... @ManyToOne(targetEntity=Place_Definer.class) @JoinColumn(name="Groupunit_Definer",nullable=false) private Place_Definer Groupunit_Definer;// ..... } @Entity public class Place_Definer extends Groupunit_Definer { ...... @Column(nullable=false,length=150) private String Classification; } 2. SQL 語句 "SELECT * FROM Place p WHERE p.Groupunit_Definer.Classification='Jurisdiction'" 3.hibernate 設置 spring.jpa.database = MYSQL spring.jpa.show-sql = true spring.jpa.hibernate.ddl-auto = update spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect 4.報錯 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Unit_Quantityp.Groupunit_Definer..Classification in 'where clause'
jpa使用left join的时候报错
springboot框架使用了jpa,写sql的时候使用了left join ,然后报错: 数据库是postgreSQL antlr.SemanticException: Path expected for join! at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:385) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3903) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3689) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3567) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:708) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:564) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:249) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:278) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:206) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:131) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:93) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:167) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1836) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:328) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:347) at com.sun.proxy.$Proxy141.createQuery(Unknown Source) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298) at com.sun.proxy.$Proxy138.createQuery(Unknown Source) at com.ido85.party.education.common.base.BaseApplication.queryPageEntityCount(BaseApplication.java:86) ........ 图片说明](https://img-ask.csdn.net/upload/201705/17/1495015427_349234.png)
爲何JPA無法自動生成表?
**1.ERROR MESSAGE** 請大家注意下面報錯其中有“2019-09-18 06:01:52.776 WARN 12248 --- [ main] o.h.b.i.SessionFactoryBuilderImpl : Unrecognized hbm2ddl_auto value : update . Supported values include create, create-drop, update, and validate. Ignoring”。 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.5.21.RELEASE) 2019-09-18 06:01:37.455 INFO 12248 --- [ main] c.s.mirrorworld.mirrorworldApplication : Starting mirrorworldApplication on LAPTOP-FAS0SHLM with PID 12248 (C:\Users\yueho\eclipse-workspace\mirrorworld\target\classes started by yueho in C:\Users\yueho\eclipse-workspace\mirrorworld) 2019-09-18 06:01:37.466 INFO 12248 --- [ main] c.s.mirrorworld.mirrorworldApplication : No active profile set, falling back to default profiles: default 2019-09-18 06:01:37.766 INFO 12248 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2f217633: startup date [Wed Sep 18 06:01:37 CST 2019]; root of context hierarchy 2019-09-18 06:01:43.613 INFO 12248 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default' 2019-09-18 06:01:43.662 INFO 12248 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2019-09-18 06:01:43.955 INFO 12248 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.12.Final} 2019-09-18 06:01:43.959 INFO 12248 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2019-09-18 06:01:43.962 INFO 12248 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist 2019-09-18 06:01:44.282 INFO 12248 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 2019-09-18 06:01:51.899 INFO 12248 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect **2019-09-18 06:01:52.776 WARN 12248 --- [ main] o.h.b.i.SessionFactoryBuilderImpl : Unrecognized hbm2ddl_auto value : update . Supported values include create, create-drop, update, and validate. Ignoring** 2019-09-18 06:01:53.639 INFO 12248 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2019-09-18 06:01:58.151 INFO 12248 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup 2019-09-18 06:01:58.180 INFO 12248 --- [ main] c.s.mirrorworld.mirrorworldApplication : Started mirrorworldApplication in 21.641 seconds (JVM running for 23.004) 2019-09-18 06:02:20.999 INFO 12248 --- [WT-EventQueue-0] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory Hibernate: select unit_quant0_.id as id1_18_, unit_quant0_.formula as formula2_18_, unit_quant0_.name as name3_18_, unit_quant0_.symbol as symbol4_18_, unit_quant0_.unit_quantity_type as unit_qua5_18_ from unit_quantity unit_quant0_ where unit_quant0_.id=? 2019-09-18 06:02:21.607 WARN 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02 2019-09-18 06:02:21.607 ERROR 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'mirrorworld.unit_quantity' doesn't exist Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:375) at com.sun.proxy.$Proxy86.getResultList(Unknown Source) at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Simply_get_thing_list(Thing_Persistence_Service.java:498) at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Get_thing_list_simpler_query_string(Thing_Persistence_Service.java:461) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value_duplication_checking(Thing_Aspect.java:290) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value(Thing_Aspect.java:157) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values(Thing_Aspect.java:116) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values_before_saving(Thing_Aspect.java:74) at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Save_thing_list(Thing_List_Service.java:470) at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Manage_user_intention(Thing_List_Service.java:68) at com.stepforward.mirrorworld.p2_base_bean.Thing_Editor_Dispatcher.Manage_user_intention(Thing_Editor_Dispatcher.java:28) at com.stepforward.mirrorworld.p4_view.Listener_Thing_List_Editor_View_Button.actionPerformed(Listener_Thing_List_Editor_View_Button.java:38) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79) at org.hibernate.loader.Loader.getResultSet(Loader.java:2117) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1900) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1876) at org.hibernate.loader.Loader.doQuery(Loader.java:919) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) at org.hibernate.loader.Loader.doList(Loader.java:2617) at org.hibernate.loader.Loader.doList(Loader.java:2600) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429) at org.hibernate.loader.Loader.list(Loader.java:2424) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483) ... 52 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mirrorworld.unit_quantity' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) at com.sun.proxy.$Proxy87.executeQuery(Unknown Source) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70) ... 68 more Hibernate: select unit_quant0_.id as id1_18_, unit_quant0_.formula as formula2_18_, unit_quant0_.name as name3_18_, unit_quant0_.symbol as symbol4_18_, unit_quant0_.unit_quantity_type as unit_qua5_18_ from unit_quantity unit_quant0_ where unit_quant0_.id=? 2019-09-18 06:02:22.120 WARN 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02 2019-09-18 06:02:22.121 ERROR 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'mirrorworld.unit_quantity' doesn't exist Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:375) at com.sun.proxy.$Proxy86.getResultList(Unknown Source) at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Simply_get_thing_list(Thing_Persistence_Service.java:498) at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Get_thing_list_simpler_query_string(Thing_Persistence_Service.java:461) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value_duplication_checking(Thing_Aspect.java:290) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value(Thing_Aspect.java:157) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values(Thing_Aspect.java:116) at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values_before_saving(Thing_Aspect.java:74) at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Save_thing_list(Thing_List_Service.java:470) at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Manage_user_intention(Thing_List_Service.java:68) at com.stepforward.mirrorworld.p2_base_bean.Thing_Editor_Dispatcher.Manage_user_intention(Thing_Editor_Dispatcher.java:28) at com.stepforward.mirrorworld.p4_view.Listener_Thing_List_Editor_View_Button.actionPerformed(Listener_Thing_List_Editor_View_Button.java:38) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79) at org.hibernate.loader.Loader.getResultSet(Loader.java:2117) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1900) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1876) at org.hibernate.loader.Loader.doQuery(Loader.java:919) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) at org.hibernate.loader.Loader.doList(Loader.java:2617) at org.hibernate.loader.Loader.doList(Loader.java:2600) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429) at org.hibernate.loader.Loader.list(Loader.java:2424) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483) ... 52 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mirrorworld.unit_quantity' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) at com.sun.proxy.$Proxy87.executeQuery(Unknown Source) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70) ... 68 more 2019-09-18 06:02:23.818 INFO 12248 --- [ Thread-4] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2f217633: startup date [Wed Sep 18 06:01:37 CST 2019]; root of context hierarchy 2019-09-18 06:02:23.821 INFO 12248 --- [ Thread-4] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown 2019-09-18 06:02:23.849 INFO 12248 --- [ Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' **2.APPLICATION PROPERTIES** spring.datasource.url=jdbc:mysql://127.0.0.1:3306/mirrorworld spring.datasource.username=root spring.datasource.password=mirror spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.max-idle=10 spring.datasource.max-wait=10000 spring.datasource.min-idle=5 spring.datasource.initial-size=5 server.port=8011 server.session.timeout=10 server.tomcat.uri-encoding=UTF-8 spring.jpa.database=MYSQL spring.jpa.show-sql=true spring.jpa.hibernate.format_sql=false spring.jpa.generate-ddl=true spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect **3.APPLICATION** @EntityScan ( basePackages = { "com.stepforward.mirrorworld.p3_application_bean.Unit" } ) @EnableJpaRepositories ( basePackages = { "com.stepforward.mirrorworld.p3_application_bean.Unit" } ) @SpringBootApplication public class mirrorworldApplication { ...... } **4.ENTITY** @Entity public class Unit_Quantity extends Thing { @Id @GenericGenerator(name="assigned", strategy="assigned") @GeneratedValue(generator="assigned") @Column(nullable=false,length=100) private String Id; @Column(nullable=false,length=150) private String Name; @Column(nullable=false,length=20) private String Unit_Quantity_Type; @Column(nullable=false,length=20) private String Symbol; @Column(nullable=true,length=100) private String Formula; ...... }
springboot JPA的多表查询只能是关系表或者用hql来查询的么?
springboot 如上,看了很多教程,对于多表查询要么是 @Query注解用hql来查询,要么就是@ManyToOne 还有其他方式么?我们数据库表是不建立关系的.
关于hibernate中的HQL语句查询的问题
我的代码中Student类中设置了Set<Teacher> teacher属性 我的HQL语句是这样的 select s.teacher,s.name from Student as s 想问一下 我用什么接收这两个数据啊,数组还是List,Map等... 控制台总会报出这样的错 org.hibernate.exception.SQLGrammarException: could not extract ResultSet 求解答一下 (我只输出teacher对象的话没问题,加了个name属性就不管怎么存,取出来都是错的)
Mysql的select lase_insert_id()在HQL下怎么写?
我用的是JPA然后采用Hibernate框架 在Repository里 @Query("select last_insert_id()") int selectLastInsertId(); 这样写 可是报错了
Spring Boot 使用JPA连接MySQL数据库报错 is not mapped
小白向各位大侠求助: 创建Spring Boot 工程时,使用JPA连接MySQL数据库,查询时报错,报错信息如下: ``` 2018-06-04 06:34:44.959 ERROR 6116 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped [select t from Person t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped [select t from Person t]] with root cause org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:169) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:79) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:326) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3706) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3595) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:720) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:576) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:313) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:261) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:266) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:189) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:141) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:553) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:662) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350) ~[spring-orm-5.0.6.RELEASE.jar:5.0.6.RELEASE] at com.sun.proxy.$Proxy76.createQuery(Unknown Source) ~[na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:304) ~[spring-orm-5.0.6.RELEASE.jar:5.0.6.RELEASE] at com.sun.proxy.$Proxy76.createQuery(Unknown Source) ~[na:na] at com.neuqsoft.demo.repository.impl.PersonDaoImpl.findAll(PersonDaoImpl.java:52) ~[classes/:na] at com.neuqsoft.demo.repository.impl.PersonDaoImpl$$FastClassBySpringCGLIB$$7895840c.invoke(<generated>) ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE] at com.neuqsoft.demo.repository.impl.PersonDaoImpl$$EnhancerBySpringCGLIB$$182f86eb.findAll(<generated>) ~[classes/:na] at com.neuqsoft.demo.service.PersonService.findAll(PersonService.java:50) ~[classes/:na] at com.neuqsoft.demo.controller.PersonController.getPseronList(PersonController.java:59) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468) [tomcat-embed-core-8.5.31.jar:8.5.31] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.31.jar:8.5.31] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.31.jar:8.5.31] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131] ``` 实体文件: ``` @Entity @Table(name = "person") public class Person { @Id @GeneratedValue(strategy = GenerationType.AUTO) private String id; @Column(name="name") private String name; @Column(name="sex") private String sex; @Column(name="tel") private String tel; @Column(name="address") private String address; @Column(name="age") private String age; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getTel() { return tel; } public void setTel(String tel) { this.tel = tel; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } } ``` 数据库表: ![图片说明](https://img-ask.csdn.net/upload/201806/04/1528064584_339931.jpg) DAO文件: ``` package com.neuqsoft.demo.repository.impl; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.neuqsoft.demo.entity.Person; import com.neuqsoft.demo.repository.PersonDao; @Repository public class PersonDaoImpl implements PersonDao { @Autowired @PersistenceContext private EntityManager entityManager; @Override public List<Person> findAll() { return this.entityManager.createQuery("select t from Person t").getResultList(); } } ``` Pom.xml ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.neuqsoft</groupId> <artifactId>DemoJPAForSpringBoot</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>DemoJPAForSpringBoot</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- custom renw --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> ``` application.properties: ``` #mysql #datasource spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/forspringboot?useSSL=false spring.datasource.username=root spring.datasource.password=1qaz!QAZ spring.jpa.show-sql= true ```
jpa @Query中获得方法的实体参数的各个属性
错误的代码片段: @Query(value = "select g from Game g where g.delFlag=0 and " + "if(:game.name !='',g.name= :game.name,1=1)") Collection<GameView> findTest(@Param("game") Game game); ``` ``` 我想在@Query的查询语句里直接取出Game里的name做判断条件,网上看的例子是: ``` @Query("select u from User u where u.firstname = :#{#customer.firstname}") List<User> findUsersByCustomersFirstname(@Param("customer") Customer customer); ``` 照着例子写好报错: ``` Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 74 [select g from org.SpringLearn.entity.game.Game g where g.delFlag=0 and if(:__$synthetic$__1 !='',g.name= :__$synthetic$__2,1=1)] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.hql.internal.ast.ErrorTracker.throwQueryException(ErrorTracker.java:93) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:277) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:191) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:143) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:119) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:595) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:704) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] ... 176 common frames omitted ``` 求大神解答
hibernate查询翻译器找不到相应的类
有对应的jar文件,jboss-transaction-api_1.1_spec-1.0.1.Final、jboss-logging-3.1.0.GA、javassist-3.18.1-GA、hibernate-jpa-2.0-api-1.0.1.Final、hibernate-core-4.2.17.Final、hibernate-commons-annotations-4.0.2.Final、dom4j-1.6.1、antlr-2.7.7。在.cfg.xml文件中配置有<property name="hibernate.query.factory_class">org.hibernate.hql.ast.HqlToken</property> 但运行后还报错 Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.hql.ast.ASTQueryTranslatorFactory] at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:151) at org.hibernate.cfg.SettingsFactory.createQueryTranslatorFactory(SettingsFactory.java:586) ... 94 more Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.hql.ast.ASTQueryTranslatorFactory at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:318) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:148) ... 95 more
JPA 删除报错问题
删除表b_calculation_rule的时候为什么会去插入一张HT_b_calculation_rule,是不是JPA 的配置问题 Hibernate: delete from re_rule where id in (select bcalculati1_.rule_id from b_calculation_rule bcalculati1_ left outer join accumulator_rule_mapping bcalculati1_1_ on bcalculati1_.id=bcalculati1_1_.calculation_rule_id where bcalculati1_.calculation_unit_id in (?)) Hibernate: insert into HT_b_calculation_rule select bcalculati0_.id as id from b_calculation_rule bcalculati0_ left outer join accumulator_rule_mapping bcalculati0_1_ on bcalculati0_.id=bcalculati0_1_.calculation_rule_id where calculation_unit_id in (?) 2011-07-07 09:23:56 ERROR com.esi.bfp.server.support.GWTRPCServiceExporter Invocation Exception: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.esi.bfp.server.support.GWTRPCServiceExporter.invokeMethodOnService(GWTRPCServiceExporter.java:184) at com.esi.bfp.server.support.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:301) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) at com.esi.bfp.server.support.GWTRPCServiceExporter.handleRequest(GWTRPCServiceExporter.java:351) at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097) at com.esi.bfp.server.listener.CacheFilter.doFilter(CacheFilter.java:29) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488) Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not insert/select ids for bulk delete; nested exception is org.hibernate.exception.SQLGrammarException: could not insert/select ids for bulk delete at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:95) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:352) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:62) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:146) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy52.deleteByCuIds(Unknown Source) at com.esi.bfp.server.service.impl.BenefitIndServiceImpl.deleteCu(BenefitIndServiceImpl.java:394) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy71.deleteCu(Unknown Source) at com.esi.bfp.server.rpcservice.BenefitIndRPCServiceImpl.deleteCu(BenefitIndRPCServiceImpl.java:110) ... 39 more Caused by: org.hibernate.exception.SQLGrammarException: could not insert/select ids for bulk delete at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.hql.ast.exec.MultiTableDeleteExecutor.execute(MultiTableDeleteExecutor.java:125) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:419) at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:283) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1168) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:117) at org.hibernate.ejb.QueryImpl.executeUpdate(QueryImpl.java:51) at com.esi.bfp.server.dao.impl.BCalculationRuleDaoImpl.deleteByCuIds(BCalculationRuleDaoImpl.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:138) ... 57 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'bfp_full_dev.HT_b_calculation_rule' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.Util.getInstance(Util.java:382) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.hibernate.hql.ast.exec.MultiTableDeleteExecutor.execute(MultiTableDeleteExecutor.java:116) ... 71 more 删除表b_calculation_rule的时候为什么会去插入一张HT_b_calculation_rule,是不是JPA 的配置问题
hibernate读取EhCache缓存的问题。
如下查询1000-2000左右的数据,有时就会报这个异常,大神们,怎么解决! 十月 20, 2017 5:40:04 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [XXXX] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cache.CacheException: method <init> (Ljava/lang/Throwable;)V not found] with root cause java.lang.NoSuchMethodError: org.hibernate.cache.CacheException: method <init>(Ljava/lang/Throwable;)V not found at net.sf.ehcache.hibernate.EhCache.get(EhCache.java:103) at org.hibernate.cache.ReadWriteCache.get(ReadWriteCache.java:80) at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache (DefaultLoadEventListener.java:486) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:357) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557) at org.hibernate.type.EntityType.resolve(EntityType.java:379) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) at org.hibernate.loader.Loader.doQuery(Loader.java:717) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2211) at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2127) at org.hibernate.loader.Loader.list(Loader.java:2087) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67) at com.shopping.core.base.GenericEntityDao$2.doInJpa(GenericEntityDao.java:86) at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184) at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:147) at com.shopping.core.base.GenericEntityDao.query(GenericEntityDao.java:71) at com.shopping.core.base.GenericDAO.query(GenericDAO.java:98) at com.shopping.foundation.service.impl.GoodsServiceImpl.query(GoodsServiceImpl.java:92) at com.shopping.foundation.service.impl.GoodsServiceImpl$$FastClassByCGLIB$$49a06392.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint (Cglib2AopProxy.java:700) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke (TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept (Cglib2AopProxy.java:635) at com.shopping.foundation.service.impl.GoodsServiceImpl$$EnhancerByCGLIB$$36bbd4e7.query(<generated>) at com.shopping.view.web.action.IndexViewAction.wapindex(IndexViewAction.java:839) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod (HandlerMethodInvoker.java:421) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod (HandlerMethodInvoker.java:136) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod (AnnotationMethodHandlerAdapter.java:326) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle (AnnotationMethodHandlerAdapter.java:313) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.shopping.core.filter.ShopFilter.doFilter(ShopFilter.java:111) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.shopping.core.filter.SecondDomainFilter.doFilter(SecondDomainFilter.java:58) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:378) at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke (FilterSecurityInterceptor.java:109) at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter (FilterSecurityInterceptor.java:83) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke (FilterSecurityInterceptor.java:109) at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter (FilterSecurityInterceptor.java:83) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp (SessionFixationProtectionFilter.java:67) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at com.shopping.core.security.support.ShopSecurityExceptionFilter.doFilterHttp (ShopSecurityExceptionFilter.java:64) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp (ExceptionTranslationFilter.java:101) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp (SecurityContextHolderAwareRequestFilter.java:91) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter (FilterChainProxy.java:390) at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89) at com.shopping.core.filter.NorLogoutFilter.doFilterHttp(NorLogoutFilter.java:63) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter
hibernate查询是否使用了ehcache的缓存了?
下面是测试代码: package org.abin.lee.test; import java.util.List; import junit.framework.TestCase; import org.abin.lee.entity.Department; import org.abin.lee.service.UserService; import org.junit.Before; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestQueryEhCache extends TestCase { public UserService userService; private ApplicationContext context; @Before public void setUp() { context = new ClassPathXmlApplicationContext(new String[] { "org/abin/lee/spring/applicationContext-resource.xml", "org/abin/lee/spring/applicationContext-service.xml", "org/abin/lee/spring/applicationContext-dao.xml" }); } public void testQueryEhCache() { userService = (UserService) this.context.getBean("userService"); List<Department> list=null; System.out.println("下面是执行第一次查询"); try { list= this.userService.findAllDepartment(); } catch (Exception e) { e.printStackTrace(); } for(Department department:list){ System.out.println("did="+department.getDid()+",dname="+department.getDname()+",employee="+department.getEmployee()); } System.out.println("下面是执行第二次查询"); try { list= this.userService.findAllDepartment(); } catch (Exception e) { e.printStackTrace(); } for(Department department:list){ System.out.println("did="+department.getDid()+",dname="+department.getDname()+",employee="+department.getEmployee()); } } public UserService getUserService() { return userService; } public void setUserService(UserService userService) { this.userService = userService; } } 下面是控制台的打印信息: 2012-05-15 12:24:09 [org.springframework.context.support.ClassPathXmlApplicationContext]-[INFO] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@a0dcd9: startup date [Tue May 15 12:24:09 CST 2012]; root of context hierarchy 2012-05-15 12:24:09 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from class path resource [org/abin/lee/spring/applicationContext-resource.xml] 2012-05-15 12:24:10 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from class path resource [org/abin/lee/spring/applicationContext-service.xml] 2012-05-15 12:24:10 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from class path resource [org/abin/lee/spring/applicationContext-dao.xml] 2012-05-15 12:24:10 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[INFO] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1362012: defining beans [dataSource,sessionFactory,hibernateTemplate,transactionManager,transactionInterceptor,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator#0,userService,userDao]; root of factory hierarchy 2012-05-15 12:24:10 [org.hibernate.cfg.Environment]-[INFO] Hibernate 3.2.5 2012-05-15 12:24:10 [org.hibernate.cfg.Environment]-[INFO] hibernate.properties not found 2012-05-15 12:24:10 [org.hibernate.cfg.Environment]-[INFO] Bytecode provider name : cglib 2012-05-15 12:24:10 [org.hibernate.cfg.Environment]-[INFO] using JDK 1.4 java.sql.Timestamp handling 2012-05-15 12:24:11 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: org.abin.lee.entity.Department -> department 2012-05-15 12:24:11 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: org.abin.lee.entity.Employee -> employee 2012-05-15 12:24:11 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping collection: org.abin.lee.entity.Department.employee -> employee 2012-05-15 12:24:11 [org.springframework.orm.hibernate3.LocalSessionFactoryBean]-[INFO] Building new Hibernate SessionFactory 2012-05-15 12:24:11 [org.hibernate.connection.ConnectionProviderFactory]-[INFO] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] RDBMS: MySQL, version: 5.5.15 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.0-beta ( $Date: 2005-11-17 16:14:47 +0100 (Thu, 17 Nov 2005) $, $Revision$ ) 2012-05-15 12:24:11 [org.hibernate.dialect.Dialect]-[INFO] Using dialect: org.hibernate.dialect.MySQLDialect 2012-05-15 12:24:11 [org.hibernate.transaction.TransactionFactoryFactory]-[INFO] Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory 2012-05-15 12:24:11 [org.hibernate.transaction.TransactionManagerLookupFactory]-[INFO] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Automatic flush during beforeCompletion(): disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Automatic session close at end of transaction: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC batch size: 15 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC batch updates for versioned data: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Scrollable result sets: enabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC3 getGeneratedKeys(): enabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Connection release mode: after_transaction 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Maximum outer join fetch depth: 2 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Default batch fetch size: 1 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Generate SQL with comments: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Order SQL updates by primary key: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Order SQL inserts for batching: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2012-05-15 12:24:11 [org.hibernate.hql.ast.ASTQueryTranslatorFactory]-[INFO] Using ASTQueryTranslatorFactory 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Query language substitutions: {} 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] JPA-QL strict compliance: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Second-level cache: enabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Query cache: enabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Cache provider: org.hibernate.cache.EhCacheProvider 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Optimize cache for minimal puts: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Structured second-level cache entries: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Echoing all SQL to stdout 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Statistics: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Deleted entity synthetic identifier rollback: disabled 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Default entity-mode: pojo 2012-05-15 12:24:11 [org.hibernate.cfg.SettingsFactory]-[INFO] Named query checking : enabled 2012-05-15 12:24:11 [org.hibernate.impl.SessionFactoryImpl]-[INFO] building session factory 2012-05-15 12:24:12 [org.hibernate.cache.CacheFactory]-[DEBUG] instantiating cache region: org.abin.lee.entity.Employee usage strategy: read-only 2012-05-15 12:24:12 [org.hibernate.cache.CacheFactory]-[WARN] read-only cache configured for mutable class: org.abin.lee.entity.Employee 2012-05-15 12:24:12 [org.hibernate.cache.CacheFactory]-[DEBUG] instantiating cache region: org.abin.lee.entity.Department usage strategy: read-only 2012-05-15 12:24:12 [org.hibernate.cache.CacheFactory]-[WARN] read-only cache configured for mutable class: org.abin.lee.entity.Department 2012-05-15 12:24:12 [org.hibernate.impl.SessionFactoryObjectFactory]-[INFO] Not binding factory to JNDI, no JNDI name configured 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.SchemaUpdate]-[INFO] Running hbm2ddl schema update 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.SchemaUpdate]-[INFO] fetching database metadata 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.SchemaUpdate]-[INFO] updating schema 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] table found: abin.department 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] columns: [dname, did] 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] foreign keys: [] 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] indexes: [primary] 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] table found: abin.employee 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] columns: [ename, did, eid] 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] foreign keys: [fdid, fk4722e6aefea415dc] 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.TableMetadata]-[INFO] indexes: [primary, fk4722e6aefea415dc] 2012-05-15 12:24:12 [org.hibernate.tool.hbm2ddl.SchemaUpdate]-[INFO] schema update complete 2012-05-15 12:24:12 [org.hibernate.cache.UpdateTimestampsCache]-[INFO] starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache 2012-05-15 12:24:12 [org.hibernate.cache.StandardQueryCache]-[INFO] starting query cache at region: org.hibernate.cache.StandardQueryCache 2012-05-15 12:24:12 [org.springframework.orm.hibernate3.HibernateTransactionManager]-[INFO] Using DataSource [org.apache.commons.dbcp.BasicDataSource@1fa39bb] of Hibernate SessionFactory for HibernateTransactionManager 下面是执行第一次查询 2012-05-15 12:24:13 [org.hibernate.cache.StandardQueryCache]-[DEBUG] checking cached query results in region: org.hibernate.cache.StandardQueryCache 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] key: sql: select department0_.did as did0_, department0_.dname as dname0_ from abin.department department0_ order by department0_.did desc; parameters: ; named parameters: {} 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] Element for sql: select department0_.did as did0_, department0_.dname as dname0_ from abin.department department0_ order by department0_.did desc; parameters: ; named parameters: {} is null 2012-05-15 12:24:13 [org.hibernate.cache.StandardQueryCache]-[DEBUG] query results were not found in cache Hibernate: select department0_.did as did0_, department0_.dname as dname0_ from abin.department department0_ order by department0_.did desc 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Department#fde9fe25-ea81-4168-b9bc-422858128358 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Department#15d95f71-f41b-4369-a1ae-441366f57318 Hibernate: select employee0_.did as did1_, employee0_.eid as eid1_, employee0_.eid as eid1_0_, employee0_.ename as ename1_0_, employee0_.did as did1_0_ from abin.employee employee0_ where employee0_.did=? 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#788d9a5a-9085-4df9-a058-8027469a1bac 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#924fba4c-3a9c-4f33-9e09-63e49663f9a1 Hibernate: select employee0_.did as did1_, employee0_.eid as eid1_, employee0_.eid as eid1_0_, employee0_.ename as ename1_0_, employee0_.did as did1_0_ from abin.employee employee0_ where employee0_.did=? 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#291e9165-dcc2-4648-bb05-47056ba8f354 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#e789a510-2f80-4b4b-b25e-e7e48e4869da 2012-05-15 12:24:13 [org.hibernate.cache.StandardQueryCache]-[DEBUG] caching query results in region: org.hibernate.cache.StandardQueryCache; timestamp=5476580773695488 did=fde9fe25-ea81-4168-b9bc-422858128358,dname=department2,employee=[org.abin.lee.entity.Employee@5c98f3, org.abin.lee.entity.Employee@bef361] did=15d95f71-f41b-4369-a1ae-441366f57318,dname=department1,employee=[org.abin.lee.entity.Employee@e0e515, org.abin.lee.entity.Employee@10dc656] 下面是执行第二次查询 2012-05-15 12:24:13 [org.hibernate.cache.StandardQueryCache]-[DEBUG] checking cached query results in region: org.hibernate.cache.StandardQueryCache 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] key: sql: select department0_.did as did0_, department0_.dname as dname0_ from abin.department department0_ order by department0_.did desc; parameters: ; named parameters: {} 2012-05-15 12:24:13 [org.hibernate.cache.StandardQueryCache]-[DEBUG] Checking query spaces for up-to-dateness: [abin.department] 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] key: abin.department 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] Element for abin.department is null 2012-05-15 12:24:13 [org.hibernate.cache.StandardQueryCache]-[DEBUG] returning cached query results 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] key: org.abin.lee.entity.Department#fde9fe25-ea81-4168-b9bc-422858128358 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Cache hit: org.abin.lee.entity.Department#fde9fe25-ea81-4168-b9bc-422858128358 Hibernate: select employee0_.did as did1_, employee0_.eid as eid1_, employee0_.eid as eid1_0_, employee0_.ename as ename1_0_, employee0_.did as did1_0_ from abin.employee employee0_ where employee0_.did=? 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#291e9165-dcc2-4648-bb05-47056ba8f354 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#e789a510-2f80-4b4b-b25e-e7e48e4869da 2012-05-15 12:24:13 [org.hibernate.cache.EhCache]-[DEBUG] key: org.abin.lee.entity.Department#15d95f71-f41b-4369-a1ae-441366f57318 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Cache hit: org.abin.lee.entity.Department#15d95f71-f41b-4369-a1ae-441366f57318 Hibernate: select employee0_.did as did1_, employee0_.eid as eid1_, employee0_.eid as eid1_0_, employee0_.ename as ename1_0_, employee0_.did as did1_0_ from abin.employee employee0_ where employee0_.did=? 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#788d9a5a-9085-4df9-a058-8027469a1bac 2012-05-15 12:24:13 [org.hibernate.cache.ReadOnlyCache]-[DEBUG] Caching: org.abin.lee.entity.Employee#924fba4c-3a9c-4f33-9e09-63e49663f9a1 did=fde9fe25-ea81-4168-b9bc-422858128358,dname=department2,employee=[org.abin.lee.entity.Employee@ff9053, org.abin.lee.entity.Employee@5c7734] did=15d95f71-f41b-4369-a1ae-441366f57318,dname=department1,employee=[org.abin.lee.entity.Employee@1000bcf, org.abin.lee.entity.Employee@754fc] 我想知道一下,第二次查询是不是使用了hibernate的ehcache查询了? 这里的Department和Employee是一对多的关系。
ssh环境配置问题总是出现警告信息 数据库可以操作成功警告信息怎么去掉
2016-10-31 18:59:28 org.hibernate.annotations.common.Version <clinit> 信息: Hibernate Commons Annotations 3.2.0.Final 2016-10-31 18:59:28 org.hibernate.cfg.Environment <clinit> 信息: Hibernate 3.6.0.Final 2016-10-31 18:59:28 org.hibernate.cfg.Environment <clinit> 信息: hibernate.properties not found 2016-10-31 18:59:28 org.hibernate.cfg.Environment buildBytecodeProvider 信息: Bytecode provider name : javassist 2016-10-31 18:59:28 org.hibernate.cfg.Environment <clinit> 信息: using JDK 1.4 java.sql.Timestamp handling 2016-10-31 18:59:28 org.hibernate.util.DTDEntityResolver resolveEntity 警告: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide! 2016-10-31 18:59:28 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues 信息: Mapping class: cn.itcast.test.entity.Person -> person 2016-10-31 18:59:28 org.hibernate.cfg.Configuration applyHibernateValidatorLegacyConstraintsOnDDL 信息: Hibernate Validator not found: ignoring 2016-10-31 18:59:28 org.hibernate.cfg.search.HibernateSearchEventListenerRegister enableHibernateSearch 信息: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled. 2016-10-31 18:59:28 org.hibernate.connection.ConnectionProviderFactory initializeConnectionProviderFromConfig 信息: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Database -> name : MySQL version : 5.5.40 major : 5 minor : 5 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Driver -> name : MySQL-AB JDBC Driver version : mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} ) major : 5 minor : 1 2016-10-31 18:59:28 org.hibernate.dialect.Dialect <init> 信息: Using dialect: org.hibernate.dialect.MySQL5Dialect 2016-10-31 18:59:28 org.hibernate.engine.jdbc.JdbcSupportLoader useContextualLobCreation 信息: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4 2016-10-31 18:59:28 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory 信息: Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory 2016-10-31 18:59:28 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup 信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Automatic flush during beforeCompletion(): disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Automatic session close at end of transaction: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC batch size: 15 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC batch updates for versioned data: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Scrollable result sets: enabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC3 getGeneratedKeys(): enabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Connection release mode: auto 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Maximum outer join fetch depth: 2 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default batch fetch size: 1 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Generate SQL with comments: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Order SQL updates by primary key: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Order SQL inserts for batching: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory 信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2016-10-31 18:59:28 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> 信息: Using ASTQueryTranslatorFactory 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query language substitutions: {} 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: JPA-QL strict compliance: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Second-level cache: enabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query cache: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory createRegionFactory 信息: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Optimize cache for minimal puts: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Structured second-level cache entries: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Echoing all SQL to stdout 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Statistics: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Deleted entity synthetic identifier rollback: disabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default entity-mode: pojo 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Named query checking : enabled 2016-10-31 18:59:28 org.hibernate.cfg.SettingsFactory buildSettings 信息: Check Nullability in Core (should be disabled when Bean Validation is on): disabled 2016-10-31 18:59:28 org.hibernate.impl.SessionFactoryImpl <init> 信息: building session factory 2016-10-31 18:59:28 org.hibernate.id.UUIDHexGenerator <init> 警告: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead 2016-10-31 18:59:29 org.hibernate.impl.SessionFactoryObjectFactory addInstance 信息: Not binding factory to JNDI, no JNDI name configured 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: Running hbm2ddl schema update 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: fetching database metadata 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: updating schema 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: table found: day17.person 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: columns: [id, name] 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: foreign keys: [] 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: indexes: [primary] 2016-10-31 18:59:29 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: schema update complete Hibernate: insert into person (name, id) values (?, ?)
juit测试ssh时总是出现下面的红色字体,虽然不影响,但是怎么能不让他显示出来
2016-6-22 21:46:26 org.hibernate.annotations.common.Version <clinit> 信息: Hibernate Commons Annotations 3.2.0.Final 2016-6-22 21:46:26 org.hibernate.cfg.Environment <clinit> 信息: Hibernate 3.6.0.Final 2016-6-22 21:46:26 org.hibernate.cfg.Environment <clinit> 信息: hibernate.properties not found 2016-6-22 21:46:26 org.hibernate.cfg.Environment buildBytecodeProvider 信息: Bytecode provider name : javassist 2016-6-22 21:46:26 org.hibernate.cfg.Environment <clinit> 信息: using JDK 1.4 java.sql.Timestamp handling 2016-6-22 21:46:26 org.hibernate.util.DTDEntityResolver resolveEntity 警告: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide! 2016-6-22 21:46:26 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues 信息: Mapping class: cn.itcast.test.entity.Person -> person 2016-6-22 21:46:26 org.hibernate.cfg.Configuration applyHibernateValidatorLegacyConstraintsOnDDL 信息: Hibernate Validator not found: ignoring 2016-6-22 21:46:26 org.hibernate.cfg.search.HibernateSearchEventListenerRegister enableHibernateSearch 信息: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled. 2016-6-22 21:46:26 org.hibernate.connection.ConnectionProviderFactory initializeConnectionProviderFromConfig 信息: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider 2016-6-22 21:46:27 org.hibernate.dialect.Dialect <init> 信息: Using dialect: org.hibernate.dialect.MySQL5Dialect 2016-6-22 21:46:27 org.hibernate.engine.jdbc.JdbcSupportLoader useContextualLobCreation 信息: Disabling contextual LOB creation as connection was null 2016-6-22 21:46:27 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory 信息: Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory 2016-6-22 21:46:27 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup 信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Automatic flush during beforeCompletion(): disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Automatic session close at end of transaction: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Scrollable result sets: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC3 getGeneratedKeys(): disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Connection release mode: auto 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Maximum outer join fetch depth: 2 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default batch fetch size: 1 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Generate SQL with comments: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Order SQL updates by primary key: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Order SQL inserts for batching: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory 信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2016-6-22 21:46:27 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> 信息: Using ASTQueryTranslatorFactory 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query language substitutions: {} 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: JPA-QL strict compliance: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Second-level cache: enabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query cache: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory createRegionFactory 信息: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Optimize cache for minimal puts: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Structured second-level cache entries: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Echoing all SQL to stdout 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Statistics: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Deleted entity synthetic identifier rollback: disabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default entity-mode: pojo 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Named query checking : enabled 2016-6-22 21:46:27 org.hibernate.cfg.SettingsFactory buildSettings 信息: Check Nullability in Core (should be disabled when Bean Validation is on): disabled 2016-6-22 21:46:27 org.hibernate.impl.SessionFactoryImpl <init> 信息: building session factory 2016-6-22 21:46:27 org.hibernate.id.UUIDHexGenerator <init> 警告: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead 2016-6-22 21:46:27 org.hibernate.impl.SessionFactoryObjectFactory addInstance 信息: Not binding factory to JNDI, no JNDI name configured 2016-6-22 21:46:27 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: Running hbm2ddl schema update 2016-6-22 21:46:27 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: fetching database metadata 2016-6-22 21:46:29 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: updating schema 2016-6-22 21:46:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: table found: itcastTax.person 2016-6-22 21:46:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: columns: [id, name] 2016-6-22 21:46:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: foreign keys: [] 2016-6-22 21:46:29 org.hibernate.tool.hbm2ddl.TableMetadata <init> 信息: indexes: [primary] 2016-6-22 21:46:29 org.hibernate.tool.hbm2ddl.SchemaUpdate execute 信息: schema update complete
hibernate的sessionFactory的问题
<div class="iteye-blog-content-contain" style="font-size: 14px;"> <pre name="code" class="错误信息">2014-8-8 17:29:19 org.hibernate.cfg.Environment &lt;clinit&gt; 信息: Hibernate 3.2.7 2014-8-8 17:29:19 org.hibernate.cfg.Environment &lt;clinit&gt; 信息: hibernate.properties not found 2014-8-8 17:29:19 org.hibernate.cfg.Environment buildBytecodeProvider 信息: Bytecode provider name : cglib 2014-8-8 17:29:19 org.hibernate.cfg.Environment &lt;clinit&gt; 信息: using JDK 1.4 java.sql.Timestamp handling 2014-8-8 17:29:19 org.hibernate.cfg.Configuration configure 信息: configuring from resource: /hibernate.cfg.xml 2014-8-8 17:29:19 org.hibernate.cfg.Configuration getConfigurationInputStream 信息: Configuration resource: /hibernate.cfg.xml 2014-8-8 17:29:19 org.hibernate.cfg.Configuration addResource 信息: Reading mappings from resource : com/bjsxt/hibernate/Student.hbm.xml 2014-8-8 17:29:20 org.hibernate.cfg.Configuration doConfigure 信息: Configured SessionFactory: null 2014-8-8 17:29:20 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues 信息: Mapping class: com.bjsxt.hibernate.Student -&gt; Student 2014-8-8 17:29:20 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: Using Hibernate built-in connection pool (not for production use!) 2014-8-8 17:29:20 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: Hibernate connection pool size: 1 2014-8-8 17:29:20 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: autocommit mode: false 2014-8-8 17:29:20 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@localhost:1521:orcl 2014-8-8 17:29:20 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: connection properties: {user=machanglun, password=****} 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: RDBMS: Oracle, version: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC driver: Oracle JDBC driver, version: 9.2.0.3.0 2014-8-8 17:29:21 org.hibernate.dialect.Dialect &lt;init&gt; 信息: Using dialect: org.hibernate.dialect.OracleDialect 2014-8-8 17:29:21 org.hibernate.dialect.Oracle9Dialect &lt;init&gt; 警告: The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect instead 2014-8-8 17:29:21 org.hibernate.dialect.OracleDialect &lt;init&gt; 警告: The OracleDialect dialect has been deprecated; use Oracle8iDialect instead 2014-8-8 17:29:21 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory 信息: Using default transaction strategy (direct JDBC transactions) 2014-8-8 17:29:21 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup 信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Automatic flush during beforeCompletion(): disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Automatic session close at end of transaction: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC batch size: 15 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC batch updates for versioned data: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Scrollable result sets: enabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: JDBC3 getGeneratedKeys(): disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Connection release mode: auto 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default batch fetch size: 1 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Generate SQL with comments: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Order SQL updates by primary key: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Order SQL inserts for batching: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory 信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2014-8-8 17:29:21 org.hibernate.hql.ast.ASTQueryTranslatorFactory &lt;init&gt; 信息: Using ASTQueryTranslatorFactory 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query language substitutions: {} 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: JPA-QL strict compliance: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Second-level cache: enabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query cache: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory createCacheProvider 信息: Cache provider: org.hibernate.cache.NoCacheProvider 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Optimize cache for minimal puts: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Structured second-level cache entries: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Echoing all SQL to stdout 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Statistics: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Deleted entity synthetic identifier rollback: disabled 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default entity-mode: pojo 2014-8-8 17:29:21 org.hibernate.cfg.SettingsFactory buildSettings 信息: Named query checking : enabled 2014-8-8 17:29:21 org.hibernate.impl.SessionFactoryImpl &lt;init&gt; 信息: building session factory Exception in thread "main" org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.&lt;init&gt;(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.&lt;init&gt;(EntityMetamodel.java:323) at org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:433) at org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:231) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1313) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at com.bjsxt.hibernate.TeacherTest.main(TeacherTest.java:14) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107) ... 10 more Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter at org.hibernate.bytecode.cglib.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:33) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:208) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:186) at org.hibernate.tuple.entity.AbstractEntityTuplizer.&lt;init&gt;(AbstractEntityTuplizer.java:128) at org.hibernate.tuple.entity.PojoEntityTuplizer.&lt;init&gt;(PojoEntityTuplizer.java:78) ... 15 more Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.CallbackFilter at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 20 more </pre> <p> </p> <pre name="code" class="hibernate.cfg.xml">&lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; &lt;hibernate-configuration&gt; &lt;session-factory&gt; &lt;!-- Database connection settings --&gt; &lt;property name="connection.driver_class"&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt; &lt;property name="connection.url"&gt;jdbc:oracle:thin:@localhost:1521:orcl&lt;/property&gt; &lt;property name="connection.username"&gt;xxx&lt;/property&gt; &lt;property name="connection.password"&gt;xxx&lt;/property&gt; &lt;!-- JDBC connection pool (use the built-in) --&gt; &lt;property name="connection.pool_size"&gt;1&lt;/property&gt; &lt;!-- SQL dialect --&gt; &lt;property name="dialect"&gt;org.hibernate.dialect.OracleDialect&lt;/property&gt; &lt;!-- Enable Hibernate's automatic session context management --&gt; &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt; &lt;!-- Disable the second-level cache --&gt; &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt; &lt;!-- Echo all executed SQL to stdout --&gt; &lt;property name="show_sql"&gt;true&lt;/property&gt; &lt;!-- Drop and re-create the database schema on startup --&gt; &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt; &lt;mapping resource="com/bjsxt/hibernate/Student.hbm.xml"/&gt; &lt;mapping class="com.bjsxt.hibernate.Teacher"/&gt; &lt;/session-factory&gt; &lt;/hibernate-configuration&gt;</pre> <p> </p> <pre name="code" class="Teacher.java">package com.bjsxt.hibernate; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Teacher { private int id; private String name; private String title; @Id public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } </pre> <p> </p> <pre name="code" class="TeacherTest">package com.bjsxt.hibernate; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; public class TeacherTest { public static void main(String[] args) { Teacher t = new Teacher(); t.setId(1); t.setName("t1"); t.setTitle("middle"); SessionFactory sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); Session session = sessionFactory.getCurrentSession(); session.beginTransaction(); session.save(t); session.getTransaction().commit(); } } </pre> <p> </p> </div>
Hibernate JPA 大规模的对象持久化时,查询涉及到的表的时候,出现查询超时现象
版主你好, 单线程同一事务大批量执行对象 persist 时,对象映射的那几个表在其它线程(其它事务)查询时出现查询超时,是否是因为产生表锁;假设不使用 Batch Update Hql 的情况下如果解决。对象关系都是简单的一对多,单向关系。 数据库服务器: SQLSERVER 2012,内存 32G,isoLocation: Read Commit
ssh2中调用weblogic配置的JNDI 识别不了 求求好心人 给个解答吧 weblogic版本12c
weblogic给出的提示信息 信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2015-5-2 17:09:00 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> 信息: Using ASTQueryTranslatorFactory 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query language substitutions: {} 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: JPA-QL strict compliance: disabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Second-level cache: enabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Query cache: disabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory createRegionFactory 信息: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Optimize cache for minimal puts: disabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Structured second-level cache entries: disabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Statistics: disabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Deleted entity synthetic identifier rollback: disabled 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Default entity-mode: pojo 2015-5-2 17:09:00 org.hibernate.cfg.SettingsFactory buildSettings 信息: Named query checking : enabled 2015-5-2 17:09:00 org.hibernate.impl.SessionFactoryImpl <init> 信息: building session factory 2015-5-2 17:09:01 org.hibernate.impl.SessionFactoryObjectFactory addInstance 信息: Not binding factory to JNDI, no JNDI name configured applicationContext.xml配置信息 <jee:jndi-lookup id="dataSource" jndi-name="jndi/cqjsrwsyy"/> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> </props> </property> <property name="packagesToScan"> <list> <value>jsrwsyy.domain</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <prop
maven 反向生成实体项目问题
想在eclipse里面弄一个maven的反向生成实体工程,配置好之后运行一直不生成实体,运行过程也不报错,运行命令使用的:hibernate3:hbm2java ,配置文件如下: pom.xml ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>AAAAA</groupId> <artifactId>AAAAA</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <groupId>AAAAA_PO</groupId> <artifactId>AAAAA_PO</artifactId> <name>AAAAA_PO</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> </dependencies> <build> <finalName>AAAAA_PO</finalName> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>hibernate3-maven-plugin</artifactId> <version>2.2</version> <dependencies> <!-- mysql链接驱动,如果是Oracle的就换成Oracle的驱动 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.25</version> </dependency> --> <!-- oracle 链接驱动 --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.1.0</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>ejb3-persistence</artifactId> <version>3.3.2.Beta1</version> </dependency> </dependencies> <!-- 运行命令: mvn hibernate3:hbm2java hibernate3:hbm2hbmxml --> <configuration> <components> <!-- 映射文件夹 项目目录下运行命令:mvn hibernate3:hbm2hbmxml --> <component> <name>hbm2hbmxml</name> <implementation>jdbcconfiguration</implementation> <outputDirectory>src/main/java/</outputDirectory> </component> <!-- 实体类 项目目录下运行命令:mvn hibernate3:hbm2java --> <component> <name>hbm2java</name> <outputDirectory>src/main/java/</outputDirectory> <implementation>jdbcconfiguration</implementation> </component> </components> <componentProperties> <!-- 生成指定表名的实体类和映射文件(不配置则生成所有的数据表) --> <revengfile>src/main/resources/reveng/hibernate.reveng.xml</revengfile> <!-- hibernate总配置文件,注意是链接数据库的信息 --> <configurationfile>src/main/resources/reveng/hibernate.cfg.xml</configurationfile> <!-- 输出的包名 --> <packagename>org</packagename> <!-- true为注解实体类方式,只需要生成java类即可,false为映射文件和非注解java实体类,结合 --> <ejb3>true</ejb3> </componentProperties> <!-- 1、如果你要生成注解方式的 java文件,就运行 mvn hibernate3:hbm2java 2、如果你要生成 hbm.xml 配合 java 的形式就先把 pom 里面 <ejb3>false</ejb3> 弄成false 然后分别运行 mvn hibernate3:hbm2hbmxml 和 mvn hibernate3:hbm2java --> </configuration> </plugin> </plugins> </build> </project> ``` hibernate.cfg.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> <property name="hibernate.connection.password">fj_inms</property> <property name="hibernate.connection.url">jdbc:oracle:thin:@127.0.0.1:1521:testOrac</property> <property name="hibernate.connection.username">fj_inms</property> <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property> </session-factory> </hibernate-configuration> ``` hibernate.reveng.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd"> <hibernate-reverse-engineering> <table-filter match-name="sys_organization"/> </hibernate-reverse-engineering> ``` 运行配置 ``` hibernate3:hbm2java ``` 运行控制台打印 ``` [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building AAAAA_PO 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> hibernate3-maven-plugin:2.2:hbm2java (default-cli) > process-resources @ AAAAA_PO >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ AAAAA_PO --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] <<< hibernate3-maven-plugin:2.2:hbm2java (default-cli) < process-resources @ AAAAA_PO <<< [INFO] [INFO] --- hibernate3-maven-plugin:2.2:hbm2java (default-cli) @ AAAAA_PO --- [INFO] using jdbcconfiguration task. [INFO] Hibernate 3.3.1.GA [INFO] hibernate.properties not found [INFO] Bytecode provider name : javassist [INFO] using JDK 1.4 java.sql.Timestamp handling [INFO] Configuration XML file loaded: file:/E:/work/workspace_mars/AAAAA/AAAAA_PO/src/main/resources/reveng/hibernate.cfg.xml [INFO] configuring from url: file:/E:/work/workspace_mars/AAAAA/AAAAA_PO/src/main/resources/reveng/hibernate.cfg.xml [INFO] Configured SessionFactory: null [INFO] No hibernate properties file loaded. [INFO] Override file: E:\work\workspace_mars\AAAAA\AAAAA_PO\src\main\resources\reveng\hibernate.reveng.xml [INFO] Using Hibernate built-in connection pool (not for production use!) [INFO] Hibernate connection pool size: 20 [INFO] autocommit mode: false [INFO] using driver: oracle.jdbc.OracleDriver at URL: jdbc:oracle:thin:@127.0.0.1:1521:testOrac [INFO] connection properties: {user=fj_inms, password=****} [INFO] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options [INFO] JDBC driver: Oracle JDBC driver, version: 11.2.0.1.0 [INFO] Using dialect: org.hibernate.dialect.Oracle10gDialect [INFO] Using default transaction strategy (direct JDBC transactions) [INFO] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) [INFO] Automatic flush during beforeCompletion(): disabled [INFO] Automatic session close at end of transaction: disabled [INFO] JDBC batch size: 15 [INFO] JDBC batch updates for versioned data: disabled [INFO] Scrollable result sets: enabled [INFO] JDBC3 getGeneratedKeys(): disabled [INFO] Connection release mode: auto [INFO] Default batch fetch size: 1 [INFO] Generate SQL with comments: disabled [INFO] Order SQL updates by primary key: disabled [INFO] Order SQL inserts for batching: disabled [INFO] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory [INFO] Using ASTQueryTranslatorFactory [INFO] Query language substitutions: {} [INFO] JPA-QL strict compliance: disabled [INFO] Second-level cache: enabled [INFO] Query cache: disabled [INFO] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory [INFO] Optimize cache for minimal puts: disabled [INFO] Structured second-level cache entries: disabled [INFO] Statistics: disabled [INFO] Deleted entity synthetic identifier rollback: disabled [INFO] Default entity-mode: pojo [INFO] Named query checking : enabled [INFO] cleaning up connection pool: jdbc:oracle:thin:@127.0.0.1:1521:testOrac [INFO] Hibernate Tools 3.2.2.GA [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.482 s [INFO] Finished at: 2017-01-16T22:12:45+08:00 [INFO] Final Memory: 18M/246M [INFO] ------------------------------------------------------------------------ [INFO] cleaning up connection pool: jdbc:oracle:thin:@127.0.0.1:1521:testOrac ```
handling transient entity in delete processing什么意思
菜鸟向各位高手求教,在使用delete时候,提示handling transient entity in delete processing. 方法如下: public void delete(Member persistentInstance) { log.debug("deleting Member instance"); try { getSession().beginTransaction(); getSession().delete(persistentInstance); log.debug("delete successful"); getSession().beginTransaction().commit(); } catch (RuntimeException re) { log.error("delete failed", re); throw re; } finally { if(getSession().beginTransaction()!=null) getSession().beginTransaction().rollback(); getSession().beginTransaction().commit(); Close(); } } 数据库是postgres。表结构CREATE TABLE member ( id integer NOT NULL, name character varying, pw character varying, sex character varying, identity serial NOT NULL, CONSTRAINT pk PRIMARY KEY (identity) ) 请指教,谢谢了!!! [b]问题补充:[/b] 其实也不是什么错误,就一直在delete processing中,就不删除数据。 信息如下: INFO - Hibernate 3.2.5 INFO - hibernate.properties not found INFO - Bytecode provider name : cglib INFO - using JDK 1.4 java.sql.Timestamp handling INFO - configuring from resource: /hibernate.cfg.xml INFO - Configuration resource: /hibernate.cfg.xml INFO - Reading mappings from resource : com/ison/hibernate/beans/Member.hbm.xml INFO - Mapping class: com.ison.hibernate.beans.Member -> member INFO - Reading mappings from resource : com/ison/hibernate/beans/Parnter.hbm.xml INFO - Mapping class: com.ison.hibernate.beans.Parnter -> parnter INFO - Configured SessionFactory: null INFO - Using Hibernate built-in connection pool (not for production use!) INFO - Hibernate connection pool size: 20 INFO - autocommit mode: false INFO - using driver: org.postgresql.Driver at URL: jdbc:postgresql://127.0.0.1:5432/Demo INFO - connection properties: {user=ison_sa, password=****} INFO - RDBMS: PostgreSQL, version: 8.2.3 INFO - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.2 JDBC3 with SSL (build 506) INFO - Using dialect: org.hibernate.dialect.PostgreSQLDialect INFO - Using default transaction strategy (direct JDBC transactions) INFO - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) INFO - Automatic flush during beforeCompletion(): disabled INFO - Automatic session close at end of transaction: disabled INFO - JDBC batch size: 15 INFO - JDBC batch updates for versioned data: disabled INFO - Scrollable result sets: enabled INFO - JDBC3 getGeneratedKeys(): disabled INFO - Connection release mode: auto INFO - Default batch fetch size: 1 INFO - Generate SQL with comments: enabled INFO - Order SQL updates by primary key: disabled INFO - Order SQL inserts for batching: disabled INFO - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory INFO - Using ASTQueryTranslatorFactory INFO - Query language substitutions: {} INFO - JPA-QL strict compliance: disabled INFO - Second-level cache: enabled INFO - Query cache: disabled INFO - Cache provider: org.hibernate.cache.NoCacheProvider INFO - Optimize cache for minimal puts: disabled INFO - Structured second-level cache entries: disabled INFO - Echoing all SQL to stdout INFO - Statistics: disabled INFO - Deleted entity synthetic identifier rollback: disabled INFO - Default entity-mode: pojo INFO - Named query checking : enabled INFO - building session factory INFO - Not binding factory to JNDI, no JNDI name configured INFO - handling transient entity in delete processing [b]问题补充:[/b] 现在上面提示不变,多了 Exception in thread "main" org.hibernate.SessionException: Session was already closed [b]问题补充:[/b] 对,你讲的非常正确!谢谢。 不过,那是我在试了N种方法后依然只得到handling transient entity in delete processing 这样的提示而无法从数据库中删除数据后,胡乱加的,呵呵。见笑了。 另外,我if控制的只有rollback(),现在我改了,可是依然没有删除数据啊, 我实在不解,请高手点拨啊! [b]问题补充:[/b] 我晕了,改了之后提示跟我一开始贴出来的一样,连结果都是一样,数据没有删除 [b]问题补充:[/b] 有id,但跟数据库的ID不一致。原来这样 [b]问题补充:[/b] 多谢! 有问题再请教!!
spring加载错误,急求解!
加载ApplicationContext.xml>>>>>>>> 2009-08-14 10:48:54,875 [org.springframework.context.support.ClassPathXmlApplicationContext]-[INFO] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@c51355: display name [org.springframework.context.support.ClassPathXmlApplicationContext@c51355]; startup date [Fri Aug 14 10:48:54 PDT 2009]; root of context hierarchy 2009-08-14 10:48:54,968 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from class path resource [applicationContext.xml] 2009-08-14 10:48:55,578 [org.springframework.context.support.ClassPathXmlApplicationContext]-[INFO] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@c51355]: org.springframework.beans.factory.support.DefaultListableBeanFactory@e0b6f5 2009-08-14 10:48:55,609 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[INFO] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e0b6f5: defining beans [dataSource,sessionFactory,userdao,userbiz,test]; root of factory hierarchy 2009-08-14 10:48:55,734 [org.hibernate.cfg.Environment]-[INFO] Hibernate 3.3.1.GA 2009-08-14 10:48:55,734 [org.hibernate.cfg.Environment]-[INFO] hibernate.properties not found 2009-08-14 10:48:55,734 [org.hibernate.cfg.Environment]-[INFO] Bytecode provider name : javassist 2009-08-14 10:48:55,734 [org.hibernate.cfg.Environment]-[INFO] using JDK 1.4 java.sql.Timestamp handling 2009-08-14 10:48:55,953 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.ext.portlet.spring.entity.User -> user 2009-08-14 10:48:55,968 [org.springframework.orm.hibernate3.LocalSessionFactoryBean]-[INFO] Building new Hibernate SessionFactory 2009-08-14 10:48:56,031 [org.hibernate.connection.ConnectionProviderFactory]-[INFO] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider 2009-08-14 10:48:56,281 [org.hibernate.cfg.SettingsFactory]-[INFO] RDBMS: MySQL, version: 5.1.32-community 2009-08-14 10:48:56,281 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.7 ( $Date: 2007-03-09 22:13:57 +0100 (Fri, 09 Mar 2007) $, $Revision: 6341 $ ) 2009-08-14 10:48:56,296 [org.hibernate.dialect.Dialect]-[INFO] Using dialect: org.hibernate.dialect.MySQLDialect 2009-08-14 10:48:56,296 [org.hibernate.transaction.TransactionFactoryFactory]-[INFO] Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory 2009-08-14 10:48:56,296 [org.hibernate.transaction.TransactionManagerLookupFactory]-[INFO] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Automatic flush during beforeCompletion(): disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Automatic session close at end of transaction: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC batch size: 15 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC batch updates for versioned data: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Scrollable result sets: enabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC3 getGeneratedKeys(): enabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Connection release mode: auto 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Maximum outer join fetch depth: 2 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Default batch fetch size: 1 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Generate SQL with comments: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Order SQL updates by primary key: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Order SQL inserts for batching: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2009-08-14 10:48:56,296 [org.hibernate.hql.ast.ASTQueryTranslatorFactory]-[INFO] Using ASTQueryTranslatorFactory 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Query language substitutions: {} 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] JPA-QL strict compliance: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Second-level cache: enabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Query cache: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Optimize cache for minimal puts: disabled 2009-08-14 10:48:56,296 [org.hibernate.cfg.SettingsFactory]-[INFO] Structured second-level cache entries: disabled 2009-08-14 10:48:56,312 [org.hibernate.cfg.SettingsFactory]-[INFO] Statistics: disabled 2009-08-14 10:48:56,312 [org.hibernate.cfg.SettingsFactory]-[INFO] Deleted entity synthetic identifier rollback: disabled 2009-08-14 10:48:56,312 [org.hibernate.cfg.SettingsFactory]-[INFO] Default entity-mode: pojo 2009-08-14 10:48:56,312 [org.hibernate.cfg.SettingsFactory]-[INFO] Named query checking : enabled 2009-08-14 10:48:56,343 [org.hibernate.impl.SessionFactoryImpl]-[INFO] building session factory 2009-08-14 10:48:56,453 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[INFO] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e0b6f5: defining beans [dataSource,sessionFactory,userdao,userbiz,test]; root of factory hierarchy Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.ext.portlet.spring.action.Test.main(Test.java:32) Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:203) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:181) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:158) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 15 more
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
使用 Docker 部署 Spring Boot 项目
Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 S...
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
Android 9.0 init 启动流程
阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、启动流程概述一、 启动流程概述Android启动流程跟Linux启动类似,大致分为如下五个阶段。1.开机上电,加载固化的ROM。2.加载BootLoader,拉起Android OS。3.加载Uboot,初始外设,引导Kernel启动等。...
相关热词 c# 输入ip c# 乱码 报表 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件
立即提问