Hibernate
Enable/Disable SQL log in Hibernate
In the logging configuration file of your choice set the logging of the following packages to the levels sho...
Continue readingLazy Loading vs Eager Loading
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 readingOne to many association using XML
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 readingCustom Naming Strategy in Hibernate
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 readingCriterias and Projections in Hibernate
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 readingOne to One Hibernate Mapping
A one-to-one association is similar to many-to-one association with a difference that the column will be set as unique.
Continue readingUni-directional One to One Relationship
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 readingUni-Directional One to Many Relationship using user managed join table
Specifies a one-way relationship between one Foo object to many Bar objects using an intermediate join table that the user manages.
Continue readingBi-Directional One to One Relationship managed by Foo.class
Specifies a two-way relationship between one Foo object to one Bar object using a foreign key.
Continue readingBi-directional One to Many Relationship using foreign key mapping
Specifies a two-way relationship between one Foo object to many Bar objects using a foreign key.
Continue reading