Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 一对多:未找到联接表错误_Java_Xml_Hibernate_Jpa - Fatal编程技术网

Java 一对多:未找到联接表错误

Java 一对多:未找到联接表错误,java,xml,hibernate,jpa,Java,Xml,Hibernate,Jpa,我正在尝试持久化一个具有对象InstrumentId列表的对象InstrumentDefinition 我正在使用XML进行映射(不允许使用注释) )也许将放在中会使Hibernate认为它有一个FK而不是联接表Hibernate似乎认为您的“instrumentIdList”有一个联接表?可能要遵循DataNucleus为地图提供的指南,以及他们的XML文档所在的位置。您正在有关注释的文档中查找XML文档。这并不奇怪。转到hibernate主页:,然后单击“文档”,然后选择您的版本并单击指向

我正在尝试持久化一个具有对象InstrumentId列表的对象InstrumentDefinition

我正在使用XML进行映射(不允许使用注释)



)

也许将
放在
中会使Hibernate认为它有一个FK而不是联接表

Hibernate似乎认为您的“instrumentIdList”有一个联接表?可能要遵循DataNucleus为地图提供的指南,以及他们的XML文档所在的位置。您正在有关注释的文档中查找XML文档。这并不奇怪。转到hibernate主页:,然后单击“文档”,然后选择您的版本并单击指向参考文档的链接。谢谢大家,找到了解决方案!
<entity name="InstrumentDefinition" class="model.InstrumentDefinition" access="FIELD">

  <table name="T_INSTRUMENT_DEFINITION"/>

  <attributes>

     <id name="symbol">
        <column name="SYMBOL" length="100" />
     </id>

     <basic name="product">
        <column name="PRODUCT" length="100"/>
     </basic>

     <basic name="securityExchange">
        <column name="SECURITY_EXCHANGE" length="100"/>
     </basic>

     <basic name="currency">
        <column name="CURRENCY" length="100"/>
     </basic>

     <basic name="product">
        <column name="PRODUCT" length="100"/>
     </basic>

     <one-to-many name="instrumentIdList" fetch="EAGER">
        <map-key name="value"/>
    </one-to-many>

  </attributes>
</entity>
<entity name="InstrumentId" class="org.fpml.v57.InstrumentId" access="FIELD">

  <table name="T_INSTRUMENT_ID"/>

  <attributes>

     <id name="instrumentIdScheme">
        <column name="INSTRUMENT_ID_SCHEME" length="100"/>
     </id>

     <id name="value">
        <column name="VALUE" length="100"/>
     </id>

  </attributes>
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="UniverseManagerServicePersistenceUnit" transaction-type="JTA">
 <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
  <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=UniverseManagerServicePersistenceDataSource)</jta-data-source>
  <mapping-file>META-INF/mapping/org/fpml/v57/InstrumentId.xml</mapping-file>                  
  <mapping-file>META-INF/mapping/model/InstrumentDefinition.xml</mapping-file>    
  <exclude-unlisted-classes>true</exclude-unlisted-classes>
  <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
  <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>