日期:2014-05-17  浏览次数:20707 次

重分悬赏,这个为题是在解决不了了,hibernate,PrimaryKeyJoinColumn列好像即是主键又是外键,然后插入数据
本帖最后由 u014490157 于 2014-04-03 15:45:55 编辑
一对多关系中,多的一方即是主键又是外键
两张表,一对多关系.

一的一方配置文件:
plasmids表:
<hibernate-mapping>
    <class name="com.wsw.model.Entries" table="ENTRIES" schema="PUBLIC" catalog="PUBLIC">
        <id name="id" type="long">
            <column name="ID" />
            <generator class="native"></generator>
        </id>
        <property name="alias" type="string">
            <column name="ALIAS" length="127" />
        </property>
        <property name="bioSafetyLevel" type="integer">
            <column name="BIO_SAFETY_LEVEL" />
        </property>
        <property name="creationTime" type="timestamp">
            <column name="CREATION_TIME" length="26" />
        </property>
        <property name="creator" type="string">
            <column name="CREATOR" length="127" />
        </property>
        <property name="creatorEmail" type="string">
            <column name="CREATOR_EMAIL" length="127" />
        </property>
        <property name="fundingSource" type="string">
            <column name="FUNDING_SOURCE" length="512" />
        </property>
        <property name="intellectualProperty" type="string">
            <column name="INTELLECTUAL_PROPERTY" length="16777216" />
        </property>
        <property name="keywords" type="string">
            <column name="KEYWORDS" length="127" />
        </property>
        <property name="longDescription" type="string">
            <column name="LONG_DESCRIPTION" length="16777216" />
        </property>
        <property name="longDescriptionType" type="string">
      &nb