Hibernate

Hibernate

Enable/Disable SQL log in Hibernate

Jun 2022

In the logging configuration file of your choice set the logging of the following packages to the levels sho...

Continue reading
Hibernate

Lazy Loading vs Eager Loading

Jun 2022

While lazy loading delays the initialization of a resource, eager loading initializes or loads a resource as soon as the code is executed. Eager loading also involves pre-loading r

Continue reading
Hibernate

One to many association using XML

Jun 2022

This is an example of how you would do a one to many mapping using XML. We will use Author and Book as our example and as..

Continue reading
Hibernate

Custom Naming Strategy in Hibernate

Jun 2022

Hibernate uses a logical name to map an entity or attribute name to a table or column name. This name can be customized in two ways: it can be ...

Continue reading
Hibernate

Criterias and Projections in Hibernate

Jun 2022

In Hibernate, the Criteria API helps us build criteria query objects dynamically. And Hibernate Projection is used to read a partial entity from the database.

Continue reading
Hibernate

One to One Hibernate Mapping

Jun 2022

A one-to-one association is similar to many-to-one association with a difference that the column will be set as unique.

Continue reading
Hibernate

Uni-directional One to One Relationship

Jun 2022

A one-to-one mapping means that one object can have only one relation – at most. In a foreign key association, one table has a foreign key column that references the primary key of

Continue reading
Hibernate

Uni-Directional One to Many Relationship using user managed join table

Jun 2022

Specifies a one-way relationship between one Foo object to many Bar objects using an intermediate join table that the user manages.

Continue reading
Hibernate

Bi-Directional One to One Relationship managed by Foo.class

Jun 2022

Specifies a two-way relationship between one Foo object to one Bar object using a foreign key.

Continue reading
Hibernate

Bi-directional One to Many Relationship using foreign key mapping

Jun 2022

Specifies a two-way relationship between one Foo object to many Bar objects using a foreign key.

Continue reading