Index
A
- aggregate operations
- performing / Performing aggregate operations, Getting ready
- tables, creating / Creating the tables
- classes, creating / Creating the classes
- data, inserting in tables / Inserting data in the tables
- category table / Inserting data in the tables
- product table / Inserting data in the tables
- sum / Sum
- avg / Avg
- min / Min, Output
- max / Max, Code
- count / Count, Code, Output
- alias
- working with / Working with an alias, How to do it…, How it works…, There's more…
- annotation
- about / Introduction
- advantages / Introduction
- annotation-based hibernate mapping
- providing / Providing an annotation-based hibernate mapping, How it works…
- class, declaring / Declaring a class — Table for the database
- ID, declaring / Declaring an ID — The primary key for the table
- object, referencing / Referencing an object
- AOP (aspects-oriented programming)
- about / Integration with Spring
- Array
- about / Persisting Array
- persisting / Persisting Array, How to do it…
- record, inserting / Inserting a record
- record, retrieving / Retrieving a record
- associations
- unidirectional / Introduction
- bidirectional / Introduction
- attributes, @Column annotation
- length / length
- nullable / nullable
- unique / unique
- columnDefinition / columnDefinition
- precision / scale and precision
- scale / scale and precision
- updatable / insertable and updatable
- insertable / insertable and updatable
- attributes, @GeneratedValue annotation
- attributes, @TableGenerator annotation
- name / name
- table / table
- pkColumnName / pkColumnName
- valueColumnName / valueColumnName
- pkColumnValue / pkColumnValue
- initialValue / initialValue
- allocationSize / allocationSize
- audit table suffix
- autogenerator column
- creating / Creating an autogenerator column
- default strategy, using / Default generation strategy
- sequence generator, using / Sequence generator
- table generator, using / Table generator
B
- batch processing
- about / Working with batch processing
- classes, creating / Creating the classes, How to do it…, How it works…
C
- @Column annotation
- attributes / There's more…
- about / There's more…
- class
- declaring, as hibernate entity / How to do it…
- column
- creating, in table / Creating a column in the table – @Column, How to do it…
- common join table
- used, for one-to-one mapping / One-to-one mapping using a common join table
- common primary key
- used, for one-to-one mapping / One-to-one mapping using a common primary key
- composite primary key column
- criteria
- creating / Creating a criteria
- creating, code for / Code
- creating, output for / Output, How it works…
- used, for restricting results / How to do it…
- used, for pagination / How to do it...
- CRUD (Create, Read, Update, Delete) operation / Introduction
D
- DAO
- about / Getting ready
- generic DAO or DAO per application / Getting ready
- per class / Getting ready
- DAO (data access object)
- about / Integration with Spring
- database
- object, saving / Saving an object to the database, How to do it…, How it works…, There's more…
- object, fetching from / Fetching an object from the database, How it works…, Explanation for scenario 2, Explanation for scenario 3
- object, removing / Removing an object from the database, Code, How it works…
- Data Definition Language (DDL) / Introduction
- Data Manipulation Language (DML) / Introduction
- default generation strategy
- using / Default generation strategy
- DI (dependency injection)
- about / Integration with Spring
E
- @Entity annotation / Declaring a class as an entity and creating a table in the database – @Entity and @Table
- Ehcache distribution
- URL / Getting ready
- Envers / Maintaining the history of an object
F
- first-level cache
- about / Working with a first-level cache
- properties / Working with a first-level cache
- classes, getting / Creating the classes
- tables, creating / Creating the tables, How it works…, There's more…
- evict method / evict (Object object), Output
- clear() method / clear(), Output
- foreign key association
- used, for one-to-one mapping / One-to-one mapping using foreign key association
- formula
- using, in hibernate / Using formula in hibernate, How to do it…, How it works…, Output
G
- @GeneratedValue annotation
- using / Default generation strategy
- attributes / Attributes available in the @GeneratedValue annotation
- generic SessionFactory provider class
H
- hbm (hibernate mapping) / How it works…
- hibernate
- features / Introduction
- libraries, getting / Getting the required libraries for hibernate, How to do it…
- JAR (Java Archive) file / Getting the required libraries for hibernate
- file, manual download / Manually downloading
- URL / How to do it…
- Maven used / Using Maven, How to do it…
- POJO (Plain Old Java Object), creating in Java / Creating a hibernate persistent class, How to do it..., There's more…
- XML-based hibernate mapping, providing / Providing an XML-based hibernate mapping, How it works…, There's more…
- annotation-based hibernate mapping, providing / Providing an annotation-based hibernate mapping, How to do it…, How it works…
- configuration providing, XML file used / Providing a hibernate configuration using an XML file, How it works...
- configuration providing, properties file used / Providing a hibernate configuration using the properties file, How it works…
- configuring, programmatically / Configuring hibernate programmatically, How to do it…
- hibernate persistent class
- HQL (Hibernate Query Language) / Introduction
- HQL queries
- about / Executing a query using HQL
- FROM clause / The FROM clause, Output
- SELECT clause / The SELECT clause
- working / How it works…
- WHERE clause / The WHERE clause
- ORDER BY clause / The ORDER BY clause
- GROUP BY clause / The GROUP BY clause
I
- @Id annotation
- using / How to do it…
- @IdClass annotation
- using / How to do it…
- interceptor
- about / Working with an interceptor, Getting ready
- classes. creating / Creating the classes
- tables, creating / Creating the tables, How to do it…, How it works…
- InterceptorTest.java, working / The working of InterceptorTest.java
- CustomInterceptor.java, working / The working of CustomInterceptor.java
- onSave Method, working / The working of onSave Method
- preFlush Method, working / The working of preFlush Method
- postFlush Method, working / The working of postFlush Method
- IoC (inversion of control)
- about / Integration with Spring
J
- JDBC (Java Database Connectivity) / Introduction
- JMS(Java Messaging Service)
- about / Integration with Spring
L
- List
- about / Persisting List
- persisting / Persisting List
- using / Persisting List
- tables, creating / Creating tables
- class, creating / Creating a class, How to do it…
- record, inserting / Inserting a record
- record, retrieving / Retrieving a record
- record, updating / Updating a record, Output
- record, deleting / Deleting a record
- working / How it works…
- Degree class, creating / There's more…, Creating classes
- degree table, creating / Creating tables
- employee record, inserting / Inserting a record
- employee record, retrieving / Retrieving a record
- Log4j
- URL / How to do it…
M
- many-to-many mapping
- about / Many-to-many mapping
- tables, creating / Creating the tables
- classes, creating / Creating the classes, How to do it…
- record, inserting / Inserting a record
- record retrieving, Developer with Technologies used / Retrieving a record using Developer with Technology
- record retrieving, Technology with Developers used / Retrieving a record using Technology with Developers, How it works…
- Map
- about / Persisting Map
- persisting / Persisting Map
- tables, creating / Creating tables
- class, creating / Creating a class, How to do it…
- record, inserting / Inserting a record, Output
- record, retrieving / Retrieving a record
- record, updating / Updating a record, Output
- record, deleting / Deleting a record, How it works…
- MCV (Model View Controller) / Integration with Struts
N
- NamedQuery
- about / Working with NamedQuery
- working with / Working with NamedQuery, How to do it…, Output, There's more…
- name attribute / name
- query attribute / query
- native SQL query
- executing / Executing a native SQL query
- scalar queries / Scalar queries, Output
- entity queries / Entity queries, Output
O
- object
- saving, to database / Saving an object to the database, How to do it…, How it works…, There's more…
- fetching, from database / Fetching an object from the database, How it works…, Scenario 1, Scenario 2, Explanation for scenario 2, Explanation for scenario 3
- removing, from database / Removing an object from the database, Code, How it works…
- updating / Updating an object, Output
- updating, code for / Code
- updating, output for / Output
- object history
- maintaining / Maintaining the history of an object
- classes, creating / Creating the classes
- tables, creating / Creating the tables, How to do it…
- working / How it works…, There's more…
- object versioning
- about / Working with the versioning of objects, Getting ready
- classes, creating / Creating the classes
- tables, creating / Creating the tables
- working / How it works…
- one-to-one mapping
- about / One-to-many mapping or many-to-one mapping
- tables, creating / Creating the tables
- classes, creating / Creating the classes
- record, inserting / Inserting a record
- record, retrieving for many-to-one-mapping / Retrieving a record – many-to-one-mapping
- record, retrieving / Retrieving a record – one-to-many-mapping, How it works…
- one-to-one mapping, common join table used
- about / One-to-one mapping using a common join table
- tables, creating / Creating the tables
- classes, creating / Creating the classes, How to do it…
- record, inserting / Inserting a record, Output, How it works…
- one-to-one mapping, common primary key used
- about / One-to-one mapping using a common primary key
- tables, creating / Creating the tables
- classes, creating / Creating the classes, How to do it…
- record, inserting / Inserting a record, How it works…
- one-to-one mapping, foreign key association used
- about / One-to-one mapping using foreign key association, Getting ready
- tables, creating / Creating the tables, Creating the tables
- classes, creating / Creating the classes, How to do it…, Creating the classes
- record, inserting / Inserting a record, Output, Inserting a record
- record retrieving, parent record used / Retrieving a record using the parent record
- record retrieving, child record used / Retrieving a record using the child record
- ORM (Object-relational Mapping) frameworks / Introduction
- features / Introduction
P
- pagination
- creating, criteria / Pagination using a criteria
- code / Code
- output / Output
- POJO class
- used, for adding caching strategy / Adding a caching strategy using a POJO class
- prefix
- changing by property, in configuration file / Changing the prefix by changing the property in the configuration file
- REV column, renaming / Renaming the REV column
- REVTYPE column, renaming / Renaming the REVTYPE column
- primary key column
- projection
- using / Using basic projection, Scenario 2:
- properties file
- used, for providing hibernate configuration / Providing a hibernate configuration using the properties file, How it works…
Q
- query
- executing, HQL used / Executing a query using HQL
- query cache
- about / Working with a query cache
- enabling / Enabling a query cache:, How it works…, Output
R
- relationships
- one-to-many / Introduction
- one-to-one / Introduction
- many-to-one / Introduction
- many-to-many / Introduction
- results
- restricting, criteria used / Restricting the results using a criteria, How to do it…
- criteria creating, code for / Code
- output / Output, How it works…
- sorting / Sorting the results
- sorting, code for / Code
- sorting, output for / How it works…
- transforming / Transforming a result
- converting, to list / Scenario 1: Converting a result to List
- converting, to map / Scenario 2: Converting a result to Map
- transforming, code for / Code
- transforming, output for / Output
- converting, to user-defined Bean / Scenario 3: Converting a result to user-defined Bean
- converting, code for / Code
- converting, output for / Output
S
- second-level cache
- about / Working with a second-level cache
- enabling / Enabling a second-level cache
- caching strategy adding, POJO class used / Adding a caching strategy using a POJO class
- flow / How it works…
- sequence generator
- using / Sequence generator
- session
- opening / Opening a new session, How it works…, There's more…
- SessionFactory
- building / Building a SessionFactory, How it works…
- features / Building a SessionFactory
- Set
- about / Persisting Set
- persisting / Persisting Set, Getting ready
- class, creating / Creating a class, How to do it…
- record, inserting / Inserting a record, Output
- record, retrieving / Retrieving a record
- record, updating / Updating a record, Output
- record, deleting / Deleting a record
- implementation / How it works…
- Spring
- about / Integration with Spring
- URL / Integration with Spring
- Spring integration
- about / Integration with Spring
- project dependency / The project dependencies
- tables, creating / Creating the tables
- model class, creating / Creating a model class
- interface, creating / Creating an interface – DAO
- configuration / The Spring configuration
- project structure, reviewing / Reviewing the project structure
- DAO implementations / The DAO implementations, Code, Output
- working / How it works…
- reference / See also…
- stateless session
- opening / Opening a stateless session
- Struts
- about / Integration with Struts
- URL / Integration with Struts
- Struts integration
- about / Integration with Struts
- project dependency / The project dependencies
- hibernate configuration / The hibernate configuration
- tables, creating / Creating the tables
- model class, creating / Creating a model class
- interface, creating / Creating an interface – DAO
- configuration / The Struts configuration
- deployment descriptor / The deployment descriptor
- Action class, creating / Creating an Action class
- Struts Action mapping / The Struts Action mapping
- project structure, reviewing / Reviewing the project structure, How to do it…
- DAO, implementing / Implementing a DAO
- view, creating / Creating view – JSP
- working / How it works…
- sub query
- executing, criteria used / Executing a subquery using a criteria, How it works…
T
- @Table annotation / How to do it…, How it works…
- @TableGenerator annotation
- using / Table generator
- attributes / Attributes available in @TableGenerator annotation
- table
- creating, in database / How to do it…
- table generator
- using / Table generator
- table per class hierarchy strategy
- about / Working with the table per class hierarchy strategy of inheritance, Getting ready
- classes, creating / Creating the classes
- tables, creating / Creating the tables
- Employee.java, annotations / Annotations used in Employee.java
- ContractualEmployee.java, annotations / Annotations used in ContractualEmployee.java
- PermanentEmployee.java, annotations / Annotations used in PermanentEmployee.java
- working / How it works…
- table per concrete class strategy
- about / Working with the table per concrete class strategy of inheritance
- classes, creating / Creating the classes
- tables, creating / Creating the tables
- Employee.java, annotations / Annotations used in Employee.java
- PermanentEmployee.java, annotations / Annotations used in PermanentEmployee.java and ContractualEmployee.java
- ContractualEmployee.java, annotations / Annotations used in PermanentEmployee.java and ContractualEmployee.java
- working / How it works…
- table per subclass strategy
- about / Working with the table per subclass strategy of inheritance
- classes, creating / Creating the classes
- tables, creating / Creating the tables, Output
- working / How it works…
U
- uniqueConstraints / How to do it…
X
- XML-based hibernate mapping
- XML file
- used, for providing hibernate configuration / Providing a hibernate configuration using an XML file, How it works..., There's more…