diff --git a/src/main/java/org/apache/ibatis/annotations/Many.java b/src/main/java/org/apache/ibatis/annotations/Many.java index f15b994b3ce..4d9fc229648 100644 --- a/src/main/java/org/apache/ibatis/annotations/Many.java +++ b/src/main/java/org/apache/ibatis/annotations/Many.java @@ -37,6 +37,7 @@ * Returns the columnPrefix. * * @return the columnPrefix. + * @since 3.5.5 */ String columnPrefix() default ""; diff --git a/src/main/java/org/apache/ibatis/annotations/One.java b/src/main/java/org/apache/ibatis/annotations/One.java index 53be73131e0..8491a00dded 100644 --- a/src/main/java/org/apache/ibatis/annotations/One.java +++ b/src/main/java/org/apache/ibatis/annotations/One.java @@ -37,6 +37,7 @@ * Returns the columnPrefix. * * @return the columnPrefix. + * @since 3.5.5 */ String columnPrefix() default ""; diff --git a/src/site/es/xdoc/java-api.xml b/src/site/es/xdoc/java-api.xml index 8f6543e5d6e..718a4043c8e 100644 --- a/src/site/es/xdoc/java-api.xml +++ b/src/site/es/xdoc/java-api.xml @@ -392,6 +392,7 @@ void rollback(boolean force) Un mapeo a una propiedad que contiene un tipo complejo. Atributos: select, que contiene el nombre completamente cualificado de un mapped statement (o un método de mapper) que puede cargar la instancia del tipo indicado. fetchType, que sobrescribe el parámetro global de configuración lazyLoadingEnabled para este mapeo. resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to a single container object from select result. + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. Nota: Habrás visto que el mapeo de tipo join no se soporta mediante el API de anotaciones. Esto es debido a las limitaciones de las anotaciones en Java que no permiten referencias circulares. @@ -401,6 +402,7 @@ void rollback(boolean force) Un mapeo a una propiedad que contiene una colección de tipos complejos. Atributos: select, que contiene el nombre completamente cualificado de un mapped statement (o un método de mapper) que puede cargar la instancia del tipo indicado. fetchType, que sobrescribe el parámetro global de configuración lazyLoadingEnabled para este mapeo. resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to collection object from select result. + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. Nota: Habrás visto que el mapeo de tipo join no se soporta mediante el API de anotaciones. Esto es debido a las limitaciones de las anotaciones en Java que no permiten referencias circulares. diff --git a/src/site/ja/xdoc/java-api.xml b/src/site/ja/xdoc/java-api.xml index 69caa5d0b4c..dd61f55721b 100644 --- a/src/site/ja/xdoc/java-api.xml +++ b/src/site/ja/xdoc/java-api.xml @@ -397,20 +397,22 @@ void rollback(boolean force) @One N/A <association> - 複雑型のプロパティのマッピング情報を定義します。属性: select, fetchType, resultMap(3.5.5以降で利用可能). + 複雑型のプロパティのマッピング情報を定義します。属性: select, fetchType, resultMap(3.5.5以降で利用可能), columnPrefix(3.5.5以降で利用可能). select は適切な型を読み込むことができるマップドステートメント(Mapper メソッド)の完全修飾名です。 fetchType はグローバルな設定 lazyLoadingEnabled をオーバーライドする場合に指定します。 resultMap は結果列を単一のコンテナオブジェクト(JavaBeanなど)へマッピングするための結果マップの完全修飾名を指定します。 + columnPrefix はネストした結果マップで結果列をグループ化するためのカラム名のプレフィックスを指定します。 NOTE アノテーション API では結合マッピングがサポートされていません。これは Java アノテーションでは循環参照が許可されないためです。 @Many N/A <collection> - 複雑型のプロパティのマッピング情報を定義します。属性: select, fetchType, resultMap(3.5.5以降で利用可能). + 複雑型のプロパティのマッピング情報を定義します。属性: select, fetchType, resultMap(3.5.5以降で利用可能), columnPrefix(3.5.5以降で利用可能). select は適切な型のコレクションを読み込むことができるマップドステートメント(Mapper メソッド)の完全修飾名です。 fetchType はグローバルな設定 lazyLoadingEnabled をオーバーライドする場合に指定します。 resultMap は結果列をコレクションオブジェクト(JavaBeanのリストなど)へマッピングするための結果マップの完全修飾名を指定します。 + columnPrefix はネストした結果マップで結果列をグループ化するためのカラム名のプレフィックスを指定します。 NOTE アノテーション API では結合マッピングがサポートされていません。これは Java アノテーションでは循環参照が許可されないためです。 diff --git a/src/site/ko/xdoc/java-api.xml b/src/site/ko/xdoc/java-api.xml index 82fd1214170..0e7c518fad8 100644 --- a/src/site/ko/xdoc/java-api.xml +++ b/src/site/ko/xdoc/java-api.xml @@ -506,6 +506,7 @@ void rollback(boolean force) 사용가능한 속성들 : select(매핑 구문의 이름, 예를들어 매퍼 메소드). fetchType, which supersedes the global configuration parameter lazyLoadingEnabled for this mapping. resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to a single container object from select result. + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. Note: 조인 매핑은 애노테이션 API 를 통해서는 지원되지 않는다는 것을 알아야 한다. 순환(circular) 참조를 허용하지 않는 자바 애노테이션의 제약사항때문이다. @@ -517,6 +518,7 @@ void rollback(boolean force) 사용가능한 속성들 : select(매핑 구문의 이름, 예를들어 매퍼 메소드) fetchType, which supersedes the global configuration parameter lazyLoadingEnabled for this mapping. resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to collection object from select result. + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. Note: 조인 매핑은 애노테이션 API 를 통해서는 지원되지 않는다는 것을 알아야 한다. 순환(circular) 참조를 허용하지 않는 자바 애노테이션의 제약사항때문이다. diff --git a/src/site/xdoc/java-api.xml b/src/site/xdoc/java-api.xml index 922c7ab3ad2..eba8fa42d0a 100644 --- a/src/site/xdoc/java-api.xml +++ b/src/site/xdoc/java-api.xml @@ -423,6 +423,7 @@ void rollback(boolean force) mapping. resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to a single container object from select result. + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. NOTE You will notice that join mapping is not supported via the Annotations API. This is due to the limitation in Java Annotations that does not allow for circular references. @@ -436,6 +437,7 @@ void rollback(boolean force) mapping. resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to collection object from select result. + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. NOTE You will notice that join mapping is not supported via the Annotations API. This is due to the limitation in Java Annotations that does not allow for circular references. diff --git a/src/site/zh/xdoc/java-api.xml b/src/site/zh/xdoc/java-api.xml index 66eaca3ecc4..0e32a15545c 100644 --- a/src/site/zh/xdoc/java-api.xml +++ b/src/site/zh/xdoc/java-api.xml @@ -388,7 +388,8 @@ try (SqlSession session = sqlSessionFactory.openSession()) {        复杂类型的单个属性映射。属性: select,指定可加载合适类型实例的映射语句(也就是映射器方法)全限定名; fetchType,指定在该映射中覆盖全局配置参数 lazyLoadingEnabled; - resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to a single container object from select result。 + resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to a single container object from select result; + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. 提示 注解 API 不支持联合映射。这是由于 Java 注解不允许产生循环引用。 @@ -398,7 +399,8 @@ try (SqlSession session = sqlSessionFactory.openSession()) {        复杂类型的集合属性映射。属性: select,指定可加载合适类型实例集合的映射语句(也就是映射器方法)全限定名; fetchType,指定在该映射中覆盖全局配置参数 lazyLoadingEnabled - resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to collection object from select result。 + resultMap(available since 3.5.5), which is the fully qualified name of a result map that map to collection object from select result; + columnPrefix(available since 3.5.5), which is column prefix for grouping select columns at nested result map. 提示 注解 API 不支持联合映射。这是由于 Java 注解不允许产生循环引用。