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 CascadeTypeOperations propagated from an entity to its related entities.
annotation ConvertA public no-arg converter for a basic field; converters also receive null values.
annotation DiscriminatorValueThe persistent discriminator for a concrete class in an entity hierarchy.
annotation ElementCollectionMapping for an owned collection of scalar values.
annotation EmbeddableA reusable value object whose scalar fields are stored in its owner table.
annotation EmbeddedFlattens an embeddable value into the owner table using a field-name prefix.
annotation EmbeddedIdFlattens an embeddable identifier into the owner table using a field-name prefix.
enum FetchTypeControls when a mapped relationship is loaded.
annotation GeneratedValueOverrides the legacy Id.autoIncrement strategy for this identifier.
enum GenerationTypeIdentifier generation strategies for a single identifier field.
annotation IndexDatabase index over mapped field names, declared on an entity.
annotation InheritanceStores an entity hierarchy in one table with an immutable discriminator.
annotation JoinColumnForeign key column on the owning table.
annotation JoinTableJoin table and key column names for an owning to-many association.
annotation ManyToManyMaps entity collection membership through a join table or an inverse mappedBy field.
annotation ManyToOneMaps a single related entity using a foreign key on the owning table.
annotation MapKeyUses a target attribute as the key of an entity relationship Map.
annotation MapKeyColumnNames the key column of a scalar element-collection Map.
annotation MappedSuperclassContributes inherited scalar and relationship mappings to concrete entities.
annotation OneToManyMaps a collection of related entities using a join table or an inverse mappedBy field.
annotation OneToOneMaps a single related entity with a unique owning foreign key, or an inverse mappedBy field.
annotation OrderByOrders a loaded entity collection by target attributes.
annotation OrderColumnPersists the positions of elements in an owning List.
annotation PostLoadInvokes a public no-argument callback after an entity is loaded or refreshed.
annotation PostPersistInvokes a public no-argument callback after the entity insert succeeds, before commit.
annotation PostRemoveInvokes a public no-argument callback after the entity row is deleted, before commit.
annotation PostUpdateInvokes a public no-argument callback after the entity update succeeds, before commit.
annotation PrePersistInvokes a public no-argument callback before inserting a new entity during flush.
annotation PreRemoveInvokes a public no-argument callback before the entity row is deleted during flush.
annotation PreUpdateInvokes a public no-argument callback before a dirty entity update during flush.
annotation VersionAn int or long counter maintained by a managed session for optimistic locking.