Annotation quick reference
| Annotation | Target | Repeatable | Description |
|---|---|---|---|
@PortalEntity | Class | No | Registers entity; sets label, module, icon, tabs, permissions, page size, soft-delete |
@PortalAction | Class | Yes | Declares action button with CDI handler, optional form, confirmation |
@PortalSecurity | Class | No | Role-based access control (view/edit/delete/action + row-level ownership) |
@PortalField | Field/Function | No | Declares UI field; sets renderer, filter, validation, width, group |
@PortalRelation | Field | No | Configures target entity, display columns, per-row actions for RELATION/RELATION_LIST |
@PortalLookup | Field/Function | No | Configures lookup label/value fields, filter, cascading dependency, parentField |
@PortalDependency | Field/Function | Yes | Conditional visibility, allowed values, numeric range |
@PortalFormField | Field | No | Describes a field in the action input form model (use @field:) |
@Regex | Field | No | Attaches regex pattern for client-side frontend validation |
RowColorProvider | Interface (class) | — | Implement to control row background color in the table |
Which renderer to use?
| Kotlin/JPA type | Recommended renderer |
|---|---|
String (short) | TEXT, EMAIL, URL, PASSWORD, COLOR |
String (long) | TEXTAREA |
String (JSON) | JSON |
Int, Long | NUMBER |
Double, BigDecimal | DECIMAL |
Boolean | BOOLEAN |
Enum | SELECT with selectEnum |
| Enum list | MULTI_SELECT with selectEnum |
Foreign key (Long?) | RELATION + @PortalRelation + @PortalLookup |
| Entity collection | RELATION_LIST + @PortalRelation + @PortalLookup |
| File path | FILE |
Recommended annotation order on a field
@Column(...) // 1. JPA
@Enumerated(...) // 2. JPA (optional)
@Regex(...) // 3. Pattern validation
@PortalField(...) // 4. UI field declaration
@PortalRelation(...) // 5. Relation config (if applicable)
@PortalLookup(...) // 6. Lookup config (if applicable)
@PortalDependency(...) // 7. Conditional rules (if applicable, repeatable)
var fieldName: Type = defaultValueLast updated on