Learn how to utilize Hibernate within Dropwizard, an extensible Java framework. This guide shows how to use it in CLI commands.
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 […]
Multi-Table Entity in Hibernate
Most entities of mine refer to a single table. But when an entity looks at more than one table to collect its attributes, Hibernate provides a handy annotation for binding in a second table — @SecondaryTable.