我有 3 张桌子:
TABLE BOOKING (
BOOK_ID
PERSONAL_ID
ORGINIZER
TITLE
PRIMARY KEY ( BOOK_ID )
FOREIGN KEY ( PERSONAL_ID)
);
TABLE ROOM
(
ID
BOOK_ID
FROM
UNTIL
QUANTITY
PRIMARY KEY ( ID)
FOREIGN KEY ( BOOK_ID)
);
TABLE PERSONAL
(
ID
PERSONAL_ID
NAME
SURNAME
EMAIL
PRIMARY KEY ( ID)
);
我在桌子 ROOM 上映射,例如:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Depp.Domain.Booking, Depp.Core" >
<id name="ID" unsaved-value="0" column="ID">
<generator class="native">
<!--<param name="sequence">GLOBALSEQUENCE</param>-->
</generator>
</id>
<property name="Title" ></property>
<property name="TitleEnabled" type="yes_no">
<column name="THEMA_ENABLED"/>
</property>
<property name="ORGANIZER" column="PERSONAL_ID" not-null="true" ></property>
<bag name="ROOM" inverse="true" lazy="true" cascade="all-delete-orphan" >
<key column="BOOK_ID"/>
<one-to-many class="Depp.Domain.ROOM, Depp.Core"/>
</bag>
</class>
我的问题是如何映射表格PERSONAL
?我的问题是PERSONAL
没有外键所以我不知道如何映射PERSONAL
。我需要从该表中获取NAME
,SURNAME
和。EMAIL
希望可以有人帮帮我
谢谢!