HibernateAssist
UPDATED:
Hibernate Assist, an Open source query analysis tool for Hibernate based application. Now don't just write Hibernate Criteria, understand the behind scene actions.
Why Hibernate Assist created?
Hibernate is one of the greatest creation but now developer don't care about query that actually matters. HibernateAssist helps Developers to understand What happened at database server.
Features
✔ Analyse Hibernate Criteria | ✔ Analyse Microsoft SQL Plan file(.sqlplan) |
✔ Browser based HTML Report | ✔ Lightweight |
✔ Execution Plan Statistics | ✔ Query Statistics |
✔ Graphical Representation | ✔ Missing Index Details |
✔ Access any hibernate.cfg.xml Property | ✔ Get Query from Criteria |
✔ Get valued query from Criteria |
Database Support
✔ Microsoft SQL Server | ✔ MySQL (5.6 and above) |
Online Sample Report
Microsoft SQL Server: http://javaquery.github.io/HibernateAssist/
MySQL: http://javaquery.github.io/HibernateAssist/mysql
Source Code (Criteria Analysis)
Criteria criteria = objSession.createCriteria(User.class); criteria.add(Restrictions.eq("Username", "vicky.thakor")); List<User> listUser = criteria.list(); HibernateAssist objHibernateAssist = new HibernateAssist(objSession); objHibernateAssist.setCriteria(criteria); objHibernateAssist.setHTMLReportFolder("C:\\Users\\javaQuery\\Desktop\\HTMLReport"); objHibernateAssist.analyseCriteria();
Source Code (Get Query from Criteria)
HibernateAssist objHibernateAssist = new HibernateAssist(objSession); objHibernateAssist.setCriteria(criteria); objHibernateAssist.getCriteriaQuery();
Source Code (Access hibernate.cfg.xml property)
HibernateAssist objHibernateAssist = new HibernateAssist(objSession); objHibernateAssist.getHibernateProperty("hibernate.show_sql");
Source Code (Microsoft SQL Server .sqlplan Analysis)
HibernateAssist objHibernateAssist = new HibernateAssist(); objHibernateAssist.setMSSQLExecutionPlanFile("C:\\Users\\javaQuery\\Desktop\\HTMLReport\\SQL Plans\\ComplexQuery.sqlplan"); objHibernateAssist.setHTMLReportFolder("C:\\Users\\javaQuery\\Desktop\\HTMLReport"); objHibernateAssist.analyseMSSQLPlan();
Source Code (Get valued Query from Criteria)
Criteria criteria = objSession.createCriteria(User.class); criteria.add(Restrictions.eq("Username", "vicky.thakor")); ListlistUser = criteria.list(); HibernateAssist objHibernateAssist = new HibernateAssist(objSession); objHibernateAssist.setCriteria(criteria); String strQuery = objHibernateAssist.getValuedCriteriaQuery(); System.out.println(strQuery);
Minimum Requirement
Hibernate 3.5 and above
Warning
Hibernate Assist is analysis tool and should be used at development phase. It'll cost a lot on Production Server. Please remove Hibernate Assist call in Final Production code.
Download Library | https://github.com/javaquery/HibernateAssist/releases/ |
0 comments :