这个我做的毕业设计中遇到的问题,在单选题表里存储多个选项内容! 下面是我的单选类和选项类 public class Choice } public class DanXuan } 下面是用来从一个字段读写选项集合的自定义类型类 public class ChoiceList : IUserType } 配置文件 <?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Test" namespace="Test"> <class name="DanXuan" table="DanXuan" lazy="false"> <id name="ID" column="ID"> <generator class="identity" /> </id> <property name="Content" column="QContent"/> <property name="Choices" column="Choices" type="Test.ChoiceList,Test"/> </class></hibernate-mapping> 相关文章: