hibernate id constrained

constrained (optional) specifies that a foreign key constraint on the primary key of the mapped table references the table of the associated class. This option affects the order in which save() and delete() are cascaded, and determines whether the association may be proxied (it is also used by the schema export tool).
引用
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.hibernate.test.model">
<class name="Student" table="student_zxm" lazy="true"><!--把类和数表关联起来-->
<id name="id" unsaved-value="null"><!--id的产生方式是uuid.hex-->
<generator class="uuid.hex" />
</id>
<property name="cardId" type="string" /><!--映射号-->
<property name="name" type="string" /><!--映射学生名-->
<property name="age" type="int" /><!--映射学生岁数-->
<one-to-one name="cer" class="Certificate"
constrained="false" fetch="join" cascade="all" /><!--映射对应的身分证对象-->
<many-to-one name="team" column="team_id" class="Team"
cascade="all" fetch="join" /><!--映射班级-->
</class>
</hibernate-mapping>

你可能感兴趣的:(Hibernate,.net,xml)