Last active
December 23, 2016 08:58
-
-
Save eatgrass/6b663d194ea623b960190df1924ed194 to your computer and use it in GitHub Desktop.
Mybatis OneToMany Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ClassADAO { | |
@Select("SELECT id, name, description FROM TableA WHERE id = #{id}") | |
@Results({@Result(property = "id", column = "id"), | |
@Result(property = "list", javaType = List.class, column = "id", | |
many = @Many(select = "ClassBDao.getClassBForClassA"))}) | |
ClassA getClassAById(@Param("id") long id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment