注释接口 JoinSql


@Retention(RUNTIME) @Target(allowedTargets=PROPERTY) @Target(METHOD) public @interface JoinSql
Be different with JoinTable, this annotation is used by UNSTRUCTURED many-to-many mappings. For example:

 @ManyToMany
 @JoinSql("SOME_FUN_1(%alias.FIELD_X) = SOME_FUN_2(%target_alias.FIELD_Y)")
 List<Target> targets();
 
Applicable restrictions
  • Can only be used with ManyToMany
  • Cannot be used by remote association, so the microservice names of declaring type and target type must be same
  • Cannot be optimized by `half-join`
  • Cannot be cached
  • Object tree with unstructured association can not be argument of save-command, otherwise, error will be raised
  • 必需元素概要

    所需元素
    修饰符和类型
    必需的元素
    说明
    A sql fragment must contain `%alias` and `%target_alias`, returns a sql predicate describes how to join the current table referenced by `%alias` and target table referenced by `%target_alias`
  • 元素详细资料

    • value

      String value
      A sql fragment must contain `%alias` and `%target_alias`, returns a sql predicate describes how to join the current table referenced by `%alias` and target table referenced by `%target_alias`