Home

解决IntelliJ IDEA Java未使用public方法警告的问题

问题原因 默认情况下,public没使用过的方法会有警告 解决方法 解决设置如下: Of course you can turn it off.Settings | Inspections | Declaration redundancy | Unused declararation. Turning off this specific inspection will turn off editor highlighting forunused public members. Unused private members will still be highlighted. 关闭后依然会检查private方法 可以通过scope来控制哪部分代码该检查

Read more

解决Hibernate找不到session的问题

问题描述 2016-06-06 15:43:24 2016-06-06 15:43:24,525 - ERROR LogInit( 55 ) -*org.hibernate.HibernateException*: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here 问题原因 没有加入事务 解决方法 将@Transactional加到方法或类,例如可以加到DAO的类,也可以加到调用DAO的方法上(service的方法) 加到service类上不会报错,但数据库操作不会提交,原因不明,可能与代理形式有关

Read more