1
を送る私のコードです:MyBatisの関係1、私はMyBatisのを使用している、と私は1対1の関係を持っていますが、私はここで、複数のパラメータを送信したいマルチパラメータ
@Mapper
public interface ParentMapper {
@Select("select o.id, o.name, o.key from parent o where o.key=#{key}")
@Result({
@Result(column = "id", property = "id")
@Result(column = "name", property = "name")
@Result(column = "id", property = "child", [email protected](select = "getChild"))
})
List<Parent> getParents(@Param("key") String key, @Param("childKey") String childKey);
@Select("select id, childName, childKey from child where parentId=#{parentId} and childKey = #{childKey}")
Child getChild(@Param("parentId")String parentId, @Param("childKey") String childKey);
}
あなたが見ることができるように論理的には、私はParentのリストを取得し、2つのパラメータを送信します:親のid、childKey、子を取得する。 しかし、@ one注釈を使用するにはどうすればいいですか?
スニペットはfalseです。埋め込みアノテーションは '@ Results'で、' @ Result'の各行の間にカンマがありません。 – blackwizard