注释接口 Static
@Retention(SOURCE)
@Target(allowedTargets=PROPERTY)
@Target(METHOD)
@Repeatable(Statics.class)
public @interface Static
-
可选元素概要
可选元素修饰符和类型可选元素说明If the alias is not empty, it specifies field for only 1 static types; Otherwise, it specifies a field for all possible static types.booleanTrue means static type has this field, false means static type excludes this field.booleanIt can only be set to true when the original dynamic property is association(@OneToOne, @OneToMany, @ManyToOne, @ManyToMany) Map the object reference/collection to id(s)If static field name is not specified, the name of original dynamic field is usedbooleanIt can only be true when the original dynamic property is not null, otherwise, error will be raised during compilation.It can only be set to true when the original dynamic property is association(@OneToOne, @OneToMany, @ManyToOne, @ManyToMany) It tells jimmer how to map the target entity type If the `@StaticType.topLevelName` of target is specified, reference the target static class directly otherwise, a nested target static class will be generated in current static class If `targetAlias` is not specified, it means a default target, object shape with only scalar fields.
-
元素详细资料
-
alias
String aliasIf the alias is not empty, it specifies field for only 1 static types; Otherwise, it specifies a field for all possible static types.- 默认值:
""
-
enabled
boolean enabledTrue means static type has this field, false means static type excludes this field.- 默认值:
true
-
optional
boolean optionalIt can only be true when the original dynamic property is not null, otherwise, error will be raised during compilation. If a non-null dynamic property is mapped to an optional static property, when static object is used to create dynamic object, null value will not be set into the dynamic instance, that means keep that dynamic property be "unloaded"- 默认值:
false
-
name
String nameIf static field name is not specified, the name of original dynamic field is used- 默认值:
""
-
idOnly
boolean idOnlyIt can only be set to true when the original dynamic property is association(@OneToOne, @OneToMany, @ManyToOne, @ManyToMany) Map the object reference/collection to id(s)- 默认值:
false
-
targetAlias
String targetAliasIt can only be set to true when the original dynamic property is association(@OneToOne, @OneToMany, @ManyToOne, @ManyToMany) It tells jimmer how to map the target entity type- If the `@StaticType.topLevelName` of target is specified, reference the target static class directly
- otherwise, a nested target static class will be generated in current static class
- If `targetAlias` is not specified, it means a default target, object shape with only scalar fields.
- otherwise, the target entity must has a `@StaticType` whose `alias` matches the `targetAlias` of this annotation. If not, compilation error will be raised.
- 默认值:
""
-