Class Annotations

Declares a class to be a data model entity.


  • name – the name of the entity, must begin with a prefix, separated by a $ sign. It is recommended to use a short name of the project as a prefix to form a separate namespace.


@Entity(name = "sales$Customer")

Defines that the class is an ancestor for some entities and its attributes must be used as part of descendant entities. Such class is not associated with any particular database table.


Defines database table for the given entity.


  • name – the table name


@Table(name = "SALES_CUSTOMER")

Defines an embedded entity stored in the same table as the owning entity.

@MetaClass annotation should be used to specify the entity name.


Defines the inheritance strategy to be used for an entity class hierarchy. It is specified on the entity class that is the root of the entity class hierarchy.


  • strategy – inheritance strategy, SINGLE_TABLE by default


Is used for defining a database column responsible for the distinction of entity types in the cases of SINGLE_TABLE and JOINED inheritance strategies.


  • name – the discriminator column name

  • discriminatorType – the discriminator column type


@DiscriminatorColumn(name = "TYPE", discriminatorType = DiscriminatorType.INTEGER)

Defines the discriminator column value for this entity.



Is used in the case of JOINED inheritance strategy to specify a foreign key column for the entity which refers to the primary key of the ancestor entity.


  • name – the name of the foreign key column of the entity

  • referencedColumnName – the name of primary key column of the ancestor entity


@PrimaryKeyJoinColumn(name = "CARD_ID", referencedColumnName = "ID")

Determines the way of getting the name of the instance returned by the Instance.getInstanceName() method.

The annotation value should be a string in the {0}|{1} format, where:

  • {0} – formatting string according to the String.format() rules, or this object method name with the prefix #. The method should return String and should have no parameters.

  • {1} – a list of field names separated by commas, corresponding to {0} format. If the method is used in {0}, the list of fields is still required as it forms the _minimal view.



Defines the list of listeners intended for reaction to the entity instance lifecycle events on the middle tier.

The annotation value should be a string or an array of strings containing class names of the listeners. See Entity Listeners.

The strings here are used instead of class references because classes of the listeners are contained only on middleware and are inaccessible for client code, while the classes of the entities are used on all tiers.



Is used for declaring non-persistent or embedded entity (meaning that @javax.persistence.Entity annotation cannot be applied)


  • name – the entity name, must begin with a prefix, separated by a $ sign. It is recommended to use a short name of the project as prefix to form a separate namespace.


@MetaClass(name = "sales$Customer")

Indicates that the entity is system only and should not be available for selection in various lists of entities, such as generic filter parameter types or dynamic attribute type.


Indicates that the entity instances are available for recovery after soft deletion on the core$Entity.restore screen available through the Administration > Data Recovery main menu item.


Indicates that editor screens opening history will be recorded with the ability to display it on the sec$ScreenHistory.browse screen available through the Help > History main menu item.


Indicates that the entity is an extension and it should be used everywhere instead of the base entity. See Functionality Extension.


This annotation can be specified for a method. Such method will be invoked right after the entity instance is created by the Metadata.create() method. This is convenient when instance initialization requires invocation of managed beans. For example, see Entity Fields Initialization.