JPA – Lazy Loading and Eager Loading

eclipse-thumbnail

Eclipselink 2.1 is a persistence provider runtime of the Java Persistence API 2.1 specification. JPA  specification defines two major strategies of loading data (Lazy and Eager). The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime that […]

JPA Entity Listeners And Callback Methods

eclipse-thumbnail

Before JPA 2.1 the concept of Entity Listeners (Injectable EntityListeners) wasn’t defined until JPA 2.1 released. The entity listener concept allows the programmer to designate a methods as a lifecycle callback methods to receive notification of entity lifecycle events. A lifecycle callback methods can be defined on an entity class, a mapped superclass, or an entity […]

EclipseLink – DDL Schema Generation in JPA 2.1

eclipse-thumbnail

If you’ve a good experience in the Java Persistence API, you can configure the JPA to generates the required schema. These are not part of the JPA implementation prior to the JPA 2.1 specification. These are considered as the extensions for the JPA provider. However, this has been standardized from the JPA 2.1 release. JPA […]

JPA Annotations – @GeneratedValue, @SequenceGenerator and @TableGenerator

eclipse-thumbnail

We’ve already discussed a different kind of primary keys, either simple or composite primary keys have assigned an inline values in the executable applications that were made. by looking into @Id, @IdClass or @EmbeddedId examples you could see that. But what if we would have some generator to generate these primary values. This tutorial explains the ID […]

JPA Entity Primary Key Using @Id and @IdClass

eclipse-thumbnail

At this tutorial we’ve explained the concept of entity identification. Entity identification is the process in which the Java Persistence Implementation identify an entity uniquely from set of entities that belong to the same type on a memory level or a database level. Each entity that located in the persistence context must has a unique […]

EclipseLink / JPA Annotations – @Embeddable, @Embedded and @EmbeddedId

eclipse-thumbnail

We’ve been providing several examples so far, most of the examples are being provided weren’t use complex persistent entity states; we are using a primitive data types such (int, String, BigDecimal, Date and etc ..). But what’s happened if you we’ve created an entity whose persistent states are other types (classes). No doubt that it […]

Eclipselink / JPA – Abstract Entity And Non-Entity Classes In The Entity Inheritance

eclipse-thumbnail

When we’ve discussed the inheritance and mapped superclasses concepts in the previous tutorials, we are avoiding concepts that could confuse the readers or makes misunderstanding for them. Most of the clarified examples didn’t provide an Abstract Entity as a target entities that can be managed by the entity manager. On the contrary an Abstract Entity was only […]

EclipseLink / JPA Annotations – @AttributeOverride And @AssociationOverride

eclipse-thumbnail

At this tutorial we’ll introduce using of @AttributeOverride and @AssocationOverride that mentioned intentionally at the @MappedSuperclass tutorial. As you’ve remembered at @MappedSuperclass annotation tutorial, we’ve mentioned at the Database Design section the possibility of using @AttributeOverride and @AssociationOverride to override the attributes and associations that inherited from the mapped superclass. An entity can inherit a persistent entity state and […]

EclipseLink / JPA Annotations – @MappedSuperclass

eclipse-thumbnail

This tutorial will explain the using of @MappedSuperclass, that could be considered as an alternative choice for sharing a persistent entity state and mapping information. An entity may inherit from a super class that provides a persistent entity state and mapping information as we’ve seen previously in the @Inheritance tutorials. Unlike using of @Inheritance, the […]

EclipseLink / JPA Annotations – @Inheritance With Table Per Concrete Strategy

eclipse-thumbnail

The inheritance is one of the most scenarios that can be encountered once we’ve been coming into business field. Inside the Java Persistence API (JPA) The entities support inheritance, polymorphic, polymorphic associations, and polymorphic queries. Both abstract and concrete classes can be entities, and both of them can be annotated with the @Entity annotation, mapped as […]