Set映射:
"1.0" encoding="utf-8"?> mapping PUBLIC"-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><class name="com.dys.model.User" table="USERS" schema="SCOTT"> "id" type="java.lang.Long"> "ID" length="8"/> class="sequence">"sequence">GUESTBOOK_SEQ "username" type="java.lang.String"> "USERNAME" length="20"/> "password" type="java.lang.String"> <set name="emails" table="EMAILS">"PASSWORD" length="20"/> "USERID"/> "java.lang.String"> set>class>"EMAIL"/>
List映射:
"1.0" encoding="utf-8"?> mapping PUBLIC"-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><class name="com.dys.model.User" table="USERS" schema="SCOTT"> "id" type="java.lang.Long"> "ID" length="8"/> class="sequence">"sequence">GUESTBOOK_SEQ "username" type="java.lang.String"> "USERNAME" length="20"/> "password" type="java.lang.String"> "PASSWORD" length="20"/> "emails" table="EMAILS">
class>"USERID"/> base="1"> "EMAIL_INDEX"> "java.lang.String"> "EMAIL"/>