请有人给我解释一下我必须在 mybatis 的映射 xml 文件中使用 ofType 和 javaType 的情况。 并解释它们之间的区别
最佳答案
javaType
是当前映射属性的类型。
ofType
是集合中元素的类型,仅在<collection>
中使用
<collection property="posts" javaType="ArrayList" column="id" ofType="Post" select="selectPostsForBlog"/>
Read as: "A collection of posts in an ArrayList of type Post."
关于mybatis - myBatis 映射中 ofType 和 javaType 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42757679/