-
Book Overview & Buying
-
Table Of Contents
Java Hibernate Cookbook
By :
Hibernate supports a useful feature that actually helps to improve the performance of the application by reducing the processing time. The feature we are talking about here is called query cache.
Hibernate caches the query result, which is frequently used. This feature is only useful if the same queries are executed frequently.
To understand the query cache, we will use the Employee POJO that was created in the previous recipe entitled Working with a first-level cache. We also need to modify hibernate.cfg.xml to enable the query cache feature:
Source file: Employee.java
@Entity
public class Employee {
@Id
@GeneratedValue
private long id;
@Column(name = "name")
private String name;
// getters and setters
}To use this feature, we will first need to enable the query cache by adding the following tag in the configuration file:
<property name="hibernate.cache.use_query_cache">true</property>
Here...
Change the font size
Change margin width
Change background colour