myBatis 映射中 ofType 和 javaType 有什么区别
What Difference between ofType and javaType in mapping in myBatis
有人可以向我解释一下我必须在 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 的映射 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."