package com.codename1.annotations.db
Mapping annotations for managed database persistence. Relationships, lifecycle callbacks, converters, and identifier generation are processed at build time. They require the Codename One annotation processor and entity enhancement; they are not runtime reflection annotations or JPA.
The established Entity, Id, Column, and DbTransient annotations remain in
com.codename1.annotations for source compatibility. Import those
together with this package when declaring managed entity mappings.
Types
enum CascadeType | Operations propagated from an entity to its related entities. |
annotation Convert | A public no-arg converter for a basic field; converters also receive null values. |
annotation DiscriminatorValue | The persistent discriminator for a concrete class in an entity hierarchy. |
annotation ElementCollection | Mapping for an owned collection of scalar values. |
annotation Embeddable | A reusable value object whose scalar fields are stored in its owner table. |
annotation Embedded | Flattens an embeddable value into the owner table using a field-name prefix. |
annotation EmbeddedId | Flattens an embeddable identifier into the owner table using a field-name prefix. |
enum FetchType | Controls when a mapped relationship is loaded. |
annotation GeneratedValue | Overrides the legacy Id.autoIncrement strategy for this identifier. |
enum GenerationType | Identifier generation strategies for a single identifier field. |
annotation Index | Database index over mapped field names, declared on an entity. |
annotation Inheritance | Stores an entity hierarchy in one table with an immutable discriminator. |
annotation JoinColumn | Foreign key column on the owning table. |
annotation JoinTable | Join table and key column names for an owning to-many association. |
annotation ManyToMany | Maps entity collection membership through a join table or an inverse mappedBy field. |
annotation ManyToOne | Maps a single related entity using a foreign key on the owning table. |
annotation MapKey | Uses a target attribute as the key of an entity relationship Map. |
annotation MapKeyColumn | Names the key column of a scalar element-collection Map. |
annotation MappedSuperclass | Contributes inherited scalar and relationship mappings to concrete entities. |
annotation OneToMany | Maps a collection of related entities using a join table or an inverse mappedBy field. |
annotation OneToOne | Maps a single related entity with a unique owning foreign key, or an inverse mappedBy field. |
annotation OrderBy | Orders a loaded entity collection by target attributes. |
annotation OrderColumn | Persists the positions of elements in an owning List. |
annotation PostLoad | Invokes a public no-argument callback after an entity is loaded or refreshed. |
annotation PostPersist | Invokes a public no-argument callback after the entity insert succeeds, before commit. |
annotation PostRemove | Invokes a public no-argument callback after the entity row is deleted, before commit. |
annotation PostUpdate | Invokes a public no-argument callback after the entity update succeeds, before commit. |
annotation PrePersist | Invokes a public no-argument callback before inserting a new entity during flush. |
annotation PreRemove | Invokes a public no-argument callback before the entity row is deleted during flush. |
annotation PreUpdate | Invokes a public no-argument callback before a dirty entity update during flush. |
annotation Version | An int or long counter maintained by a managed session for optimistic locking. |