Tag: hibernate

Quick Assessment of Hibernate Efficiency

Out of curiosity, I ran a test to compare the speed at which Hibernate completes executing HQL vs SQL vs Criteria selections. The results are pretty clear. Running the selection a thousand times:HQL Query executed in 1764 msSQL Query executed in 486 msCriteria executed in 683 ms The results were similar for other total executions. […]

Storing Enum in Hibernate 4

I recently faced a conundrum in that I wanted to use an enum to represent a value saved through Hibernate to a database. I didn’t want to store the name of the enum, rather a discriminator bound as a property of the enum. For example: In this situation, I want the status stored as an […]