<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Domain" namespace="Domain">
	<class name="HostRoomCard" table="tb_HostRoomCard">
		<id name="ID" column="ID" type="long" unsaved-value="0">
			<generator class="native" />
		</id>
		<property name="HostID" column="HostID" type="int"  />
		<property name="RoomNumber" column="RoomNumber" type="string" />
		<many-to-one name="RoomCard" column="RoomCardID" not-found="ignore" cascade="none" />
		<property name="CardNumber" column="CardNumber" type="string" />
		<many-to-one name="CardType" column="CardTypeID" not-found="ignore" cascade="none" />
		<property name="UserNumber" column="UserNumber" type="string" />
		<property name="UserName" column="UserName" type="string" />
		<property name="InCardTime" column="InCardTime" type="DateTime" />
		<property name="OutCardTime" column="OutCardTime" type="DateTime" />
		<property name="IsAlarm" column="IsAlarm" type="bool" />
		<property name="Duration" formula="DATEDIFF(MINUTE,InCardTime,ISNULL(OutCardTime,GETDATE()))" type="long" />
	</class>
</hibernate-mapping>