Hibernate中的映射是怎样写呢?- <?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 package="com.it.bean">
- <class name="DataLog" table="datalog" lazy="false">
- <id name="id" column="id">
- <generator class="identity"/>
- </id>
- <many-to-one name="data" unique="true" lazy="false"/>
- <property name="doType"></property>
- <property name="doDate"></property>
- </class>
-
- </hibernate-mapping>
复制代码- <?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 package="com.it.bean">
- <class name="Data" table="data">
- <id name="id" column="id">
- <generator class="identity"/>
- </id>
- <property name="title"></property>
- <property name="introduction"></property>
- <property name="file"></property>
- </class>
- </hibernate-mapping>
复制代码 我想实现一个Data对应多个DataLog,是不是上面的那种实现方式? |