<class name="类名" //类名(有包的话也要有包名)
table="表名" //表名
discriminator-value="C"> //可以不要
<id name="id" column="列名"> //主键必需要有的。
<generator class="increment"/>
</id>
<property name="username" column="列名"/>
<property name="password" column="列名"/>
</class>
table="表名" //表名
discriminator-value="C"> //可以不要
<id name="id" column="列名"> //主键必需要有的。
<generator class="increment"/>
</id>
<property name="username" column="列名"/>
<property name="password" column="列名"/>
</class>
本文介绍了一种ORM映射配置方法,通过XML定义类与数据库表之间的映射关系,包括类名、表名及各属性对应的列名。重点介绍了如何设置主键生成策略及其他属性的映射方式。
158

被折叠的 条评论
为什么被折叠?



