Skip to content

License

Annotation Reference

Entity Annotations

@QfEntity

Declares a class as a Q-Framework entity. Placed on the domain entity class.

java
@QfEntity(
    appKey = "app",
    name = @QfI18n(
        defaultMessage = "Product",
        texts = { @QfI18nText(locale = "ko", message = "상품") }
    ),
    autoHistoryEnabled = false,
    deletePolicy = @QfCrudPolicy(enabled = true),
    capabilityKey = "product-management"
)
public class ProductEntity { }
AttributeTypeDescriptionDefault
appKeyStringOwning client app key"" (uses declared app)
name@QfI18nLocalized display name@QfI18n(texts = {})
autoHistoryEnabledbooleanEnable automatic change historyfalse
deletePolicy@QfCrudPolicyDelete operation policy@QfCrudPolicy(enabled = false)
treePolicy@QfTreePolicyTree/hierarchical structure config@QfTreePolicy (disabled)
organizationPolicy@QfOrganizationPolicyOrganization-based data filtering@QfOrganizationPolicy(enabled = false)
masterRelation@QfMasterRelationMaster-detail relationship@QfMasterRelation(enabled = false)
capabilityKeyStringLinked capability key"" (derived from class name)
excelDownloadablebooleanEnable Excel export endpointtrue
excelUploadablebooleanEnable Excel import endpointtrue

@QfClientApp

Declares a client application. Placed on a configuration class.

java
@QfClientApp(
    key = "app",
    name = @QfI18n(
        defaultMessage = "App",
        texts = { @QfI18nText(locale = "ko", message = "일반 앱") }
    )
)
public class AppConfig { }
AttributeTypeRequiredDescription
keyStringUnique client app key
name@QfI18nLocalized display name

Capability / Permission Annotations

@QfCapability

Declares a business function area (Capability). Placed on a dedicated class.

java
@QfCapability(
    key = "product-management",
    name = @QfI18n(defaultMessage = "Product Management", texts = {}),
    entities = { ProductEntity.class },
    privileges = {
        @QfPrivilege(key = "product-management__create"),
        @QfPrivilege(key = "product-management__delete")
    }
)
public final class ProductManagementCapability { }
AttributeTypeRequiredDescription
keyStringUnique capability key
name@QfI18nLocalized display name
entitiesClass[]Primary managed entity classes
privileges@QfPrivilege[]Privileges defined by this capability

Entities are linked to a capability via @QfEntity(capabilityKey = "..."), not by placing @QfCapability on the entity class.


@QfPrivilege

Declares a permission unit within a @QfCapability.

java
@QfPrivilege(
    key = "product-management__create",
    name = @QfI18n(defaultMessage = "Create Product", texts = {})
)
AttributeTypeRequiredDescription
keyStringUnique key (scoped within Capability)
name@QfI18nLocalized display name

Security Annotations

@QfCrypto

Automatically encrypts and decrypts a field. Placed on a field.

java
@QfCrypto
private String email;

Restriction

Cannot be combined with @QfSearch (compile error).


@QfOrganizationPolicy (element)

Configures organization-based data filtering. Used as an element inside @QfEntity:

java
@QfEntity(
    organizationPolicy = @QfOrganizationPolicy(
        enabled = true,
        attribute = "orgId"   // field name holding the org ID
    )
)
AttributeTypeDescriptionDefault
enabledbooleanEnable org filteringtrue
attributeStringField name holding org ID""
includeQfOrganizationIncludeTraversal directionANCHOR_ONLY

Validation Annotations

@QfValidationRule

Declares a validation rule on a field. Repeatable.

java
@QfValidationRule(
    rule = QfValidationRule.Rule.regex,
    params = "^[A-Za-z0-9_]+$",
    invalidValueMessageKey = "validation.loginId.invalid"
)
private String loginId;
AttributeTypeRequiredDescription
ruleRuleValidation rule type
paramsString[]Rule parameters (pattern for regex)
invalidValueMessageKeyStringError message key
invalidValueMessages@QfI18nInline error message
serverOnlybooleanServer-side only validation
applyOn@QfConditionExpr[]Conditions for rule application

Rule enum values:

RuleDescriptionparams
regexCustom regexparams[0] = pattern
uniqueServer uniqueness checkparams[0] = URL (optional)
login_idLogin ID format (from config)
user_pwdPassword policy (from config)

Display Annotations

@QfListAttribute

Displays as a column in the list view.

java
@QfListAttribute(sortable = true)
private String name;
AttributeTypeDefaultDescription
sortablebooleanfalseWhether sortable
isTreeNodeTitlebooleanfalseUse as tree node title
isTreeNodeSubTitlebooleanfalseUse as tree node subtitle
cannotHidebooleanfalsePrevent user from hiding column
buttons@QfButton[]{}Row-level action buttons
exposeOn@QfExposeOn[]{}App/capability visibility rules

@QfDetailAttribute

Displays in the detail view.

java
@QfDetailAttribute
private String name;

@QfCreateAttribute

Displays as an input field in the create form.

java
@QfCreateAttribute(
    requiredOn = @QfRequiredOn(always = true)
)
private String name;
AttributeTypeDescription
requiredOn@QfRequiredOnRequired rule
readonlyOn@QfReadonlyOnRead-only rule
initialValueStringStatic initial value
showOn@QfConditionExpr[]Visibility conditions
disableOn@QfConditionExpr[]Disable conditions

@QfUpdateAttribute

Displays as an input field in the update form. Same attributes as @QfCreateAttribute.


@QfSearch

Enables the field as a search filter in the list view.

java
@QfSearch(type = QfSearch.Type.text)
private String name;

@QfSearch(type = QfSearch.Type.select)
private String status;
TypeDescription
autoAuto-detect based on field type
textPlain text input
selectSingle-select dropdown
true_or_falseBoolean toggle
multiselectMulti-select
period_dateDate range
period_datetimeDatetime range

@QfDisplayLabel

Sets the display label for a field.

java
@QfDisplayLabel(text = "Product Name")
private String name;

@QfDisplayLabel(key = "label.product.name")   // resolved from message resource
private String name;
AttributeDescription
keyMessage resource key for i18n resolution
textLiteral label text (fallback)

@QfControlType

Declares the UI control type for a field.

java
@QfControlType(QfControlType.Type.email)
private String email;

@QfControlType(QfControlType.Type.textarea)
private String description;

Structural Annotations

@QfMasterRelation (element)

Declares a master-detail relationship. Used as an element inside @QfEntity:

java
@QfEntity(
    masterRelation = @QfMasterRelation(
        enabled = true,
        masterEntityFqcn = "com.example.OrderEntity",
        masterKeyAttribute = "orderId",
        onMasterDelete = QfMasterRelation.OnMasterDelete.CASCADE_DELETE
    )
)
public class OrderItemEntity { }
onMasterDeleteDescription
CASCADE_DELETEDelete details when master is deleted
RESTRICTReject master deletion if details exist
IGNORELeave details orphaned

@QfParent / @QfTreeDepth / @QfChildren

Declare tree structure fields.

java
@QfParent
private String parentId;

@QfTreeDepth
private Integer depth;

@QfChildren
private List<CategoryEntity> children;

@QfGroup

Groups related fields together in the UI.

java
@QfGroup(key = "address_info")
private String address;

@QfGroup(key = "address_info")
private String zipCode;

Audit Trail Annotations

Auto-populated by the framework at write time:

AnnotationDescription
@QfRgsOperIdRecords the creator's user ID
@QfRgsOperDtRecords the creation timestamp
@QfRgsOperIpRecords the creator's IP address
@QfUpdtOperIdRecords the last updater's user ID
@QfUpdtOperDtRecords the last update timestamp
@QfUpdtOperIpRecords the updater's IP address
@QfDeleteOperIdRecords the deleter's user ID
@QfDeleteOperDtRecords the deletion timestamp
@QfDeleteFlagMarks the record as soft-deleted

Result Code Annotations

@QfResultCode

Declares a result code. Placed on an interface.

java
@QfResultCode(
    code = "PRODUCT_NOT_FOUND",
    httpStatus = 404,
    message = "Product not found.",
    resolution = "Check the product ID and retry."
)
public interface ProductResultCode { }

For details, see the Result Code Reference.


Internationalization Annotations

@QfI18n

Declares a localized message bundle. Used as an element inside other annotations.

java
@QfI18n(
    defaultMessage = "Product Name",
    texts = {
        @QfI18nText(locale = "ko", message = "상품명"),
        @QfI18nText(locale = "ja", message = "商品名")
    },
    key = "entity.product.name.label",   // optional; auto-generated if empty
    sync = false
)
AttributeTypeDescription
defaultMessageStringFallback text when no locale matches
texts@QfI18nText[]Locale-specific messages
keyStringMessage lookup key (auto-generated if empty)
syncbooleanSync with source on every startup

@QfI18nText

One locale-specific message within a @QfI18n bundle.

java
@QfI18nText(locale = "ko", message = "상품명")

@QfDisplayHint

Declares a hint (tooltip / placeholder) for a field.

java
@QfDisplayHint(
    i18n = @QfI18nText(locale = "en", message = "Enter the product name")
)
private String name;

Released under the Apache 2.0 License.