How do I enable statistics with Hibernate and JPA?

You can enable Hibernate statistics by setting the property hibernate.generate_statistics in the persistence.xml of your application: <property name=”hibernate.generate_statistics”>true</property> For Hibernate native application, you need to include the above property in hibernate.cfg.xml After deploying the application, you will see in your server logs the following statistics when the Hibernate session is closed: 18:16:30,502 INFO [org.hibernate.engine.internal.StatisticalLoggingSessionEventListener] (default … Read more

JBPM best practices

In this updated tutorial we will cover some of the best practices when designing or coding process with jBPM. Include multiple end events A process, by design, requires at least a Start Task and an End Task. In most cases, however, it is not advised to include a single end state where all process branches … Read more

Getting started with TestNG

TestNG is a testing framework inspired by JUnit but introducing a whole set of new functionalities. In this tutorial we will walk through the set up and execution of some example tests with TestNG.

Read more

TestNG Configuration file in a nuthell

TestNG is a testing framework inspired by JUnit but introducing a whole set of new functionalities. Let’s see how to create a sample project which uses a testng.xml configuration file to drive a Test suite TestNG Example Test suite Let’s write a proof of concept Hello World example with TestNG. In order to use it, … Read more

How to create a Web application from the command line

One of the simplest choices to create a Java Web application with Maven is the maven-archetype-webapp. This archetype provides a minimal skeleton for creating a Web application. To create an application using this archetype in batch mode, you can use the following command: Here is the resulting project: Within the webapp folder, you can add … Read more

JPA vs Hibernate in a nutshell

A fairly common question for developers approaching Object Relational Mapping (ORM) tools like Hibernate is what is the difference between Hibernate and JPA. In this article we are going to explain it in a nutshell. From an high level view, JPA is just like an interface without a concrete implementation of it. On the other … Read more