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
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 Entity Primary Key Using @Id and @IdClass
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
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
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
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
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
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 …