<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.data.entity.EtsHotelInfoV" table="ETS_HOTEL_INFO_V" entity-name="EtsHotelInfoV" schema="ETC">
<composite-id name="hotelInfoId" class="com.zte.etc.data.entity.HotelTenantId">
<key-property name="inforId" type="long">
<column name="HOTEL_INFO_ID" precision="15" scale="0" />
</key-property>
<key-property name="tenantId" type="long">
<column name="tenant_id" precision="15" scale="0" />
</key-property>
</composite-id>
<property name="enabledFlag" type="java.lang.String">
<column name="ENABLED_FLAG" length="1" />
</property>
<property name="memo" type="java.lang.String">
<column name="MEMO" length="2048" />
</property>
</class>
<class name="com.data.entity.EtsHotelInfoV" table="ETS_HOTEL_INFO_ALL_V" entity-name="EtsHotelAllInfoV" schema="ETC">
<composite-id name="hotelInfoId" class="com.zte.etc.data.entity.HotelTenantId">
<key-property name="inforId" type="long">
<column name="HOTEL_INFO_ID" precision="15" scale="0" />
</key-property>
<key-property name="tenantId" type="long">
<column name="tenant_id" precision="15" scale="0" />
</key-property>
</composite-id>
<property name="enabledFlag" type="java.lang.String">
<column name="ENABLED_FLAG" length="1" />
</property>
</class>
</hibernate-mapping>
hibernate 一个实体对应两个表
最新推荐文章于 2022-04-09 21:24:40 发布
这篇博客展示了如何使用Hibernate将一个实体类映射到两个不同的数据库表中,通过XML配置文件详细定义了实体类与表的映射关系,包括复合主键的设置和属性映射。
摘要由CSDN通过智能技术生成