Skip to content
HibernateAssist
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
lib
release
src
.classpath
.gitignore
.project
README.md

README.md

HibernateAssist

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 or above)
✔ PostgreSQL ✔ Oracle

#Configuration No configuration required to use Hibernate Assist

#Online Sample Report Hibernate Assist
Microsoft SQL Server: http://javaquery.github.io/HibernateAssist/mssql
MySQL: http://javaquery.github.io/HibernateAssist/mysql
Oracle: http://javaquery.github.io/HibernateAssist/oracle
PostgreSQL: http://javaquery.github.io/HibernateAssist/postgresql

#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"));
List<User> listUser = 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.

You can’t perform that action at this time.