一键导入
jmix-create-enum
Create a Jmix enum for entity attributes with stable database ids and localization.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a Jmix enum for entity attributes with stable database ids and localization.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Open a Jmix entity detail view from a button/action and refresh related data after save.
Add Jmix entity lifecycle event listeners to perform additional actions with saved or loaded entities.
Add complete Jmix message keys for entities, enums, views, actions, and validation text.
Configure or audit Jmix fetch plans in XML views, fragments, DataManager loads, repositories, and entity events when loading references, avoiding N+1 queries, fixing unfetched attribute errors, or tuning data loading.
Add inline editable parent-child composition UI to a Jmix detail view, when a parent entity owns child records edited via a property-bound collection container (no query loader).
Create a Jmix Flow UI detail view with XML descriptor, save-close action, messages, and policies.
| name | jmix-create-enum |
| description | Create a Jmix enum for entity attributes with stable database ids and localization. |
Use this skill when an entity attribute has a fixed set of values.
entity package.io.jmix.core.metamodel.datatype.EnumClass<T>.fromId() method annotated with @Nullable.jmix-add-i18n-keys for the <package>/<EnumClass>.<CONSTANT> key shape (e.g. com.company.app.entity/TransactionType.INCOME), NOT an all-dots FQCN.CONSTANT form.import io.jmix.core.metamodel.datatype.EnumClass;
import org.springframework.lang.Nullable;
public enum TransactionType implements EnumClass<String> {
INCOME("INCOME"),
OUTCOME("OUTCOME");
private final String id;
TransactionType(String id) {
this.id = id;
}
@Override
public String getId() {
return id;
}
@Nullable
public static TransactionType fromId(String id) {
for (TransactionType value : TransactionType.values()) {
if (value.getId().equals(id)) {
return value;
}
}
return null;
}
}
@Column(name = "TYPE", nullable = false, length = 50)
private String type;
public TransactionType getType() {
return type == null ? null : TransactionType.fromId(type);
}
public void setType(TransactionType type) {
this.type = type == null ? null : type.getId();
}
Keep one consistent id type across EnumClass<T>, getId()/fromId(), the entity field, and the Liquibase column (e.g. all String/VARCHAR). A mismatch compiles cleanly but silently corrupts load/save. Each literal id must be a hardcoded stable value, never a display label or ordinal()/name().
When binding an enum attribute in a view, use <comboBox> (its Range is an enumeration) — not entityComboBox, which is for entity associations.
io.jmix.core.EnumClass.EnumClass without a type parameter.ordinal() or enum .name() persistence.