注释接口 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.
    boolean
    True means static type has this field, false means static type excludes this field.
    boolean
    It 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 used
    boolean
    It 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 alias
      If 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 enabled
      True means static type has this field, false means static type excludes this field.
      默认值:
      true
    • optional

      boolean optional
      It 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 name
      If static field name is not specified, the name of original dynamic field is used
      默认值:
      ""
    • idOnly

      boolean idOnly
      It 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 targetAlias
      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.
      • otherwise, the target entity must has a `@StaticType` whose `alias` matches the `targetAlias` of this annotation. If not, compilation error will be raised.
      默认值:
      ""