一张信息表 一张地址类(AreaCode) 信息类(TroubleshootCallLog)
        private Long id;
private string comt;
        private int areaID;
        private AreaCode areaCode;
地址表
private int areaID;
private String areaName;
信息表
   <property name="areaID" type="java.lang.Integer">
        <column name="AREA_OCA" precision="22" scale="0" />
   </property>
配置   <many-to-one name="areaCode" column="areaID" class="fs.model.AreaCode" cascade="all"/>  查询语句  from  TroubleshootCallLog  tc  where  1=1  
报错
ORA-00904: "TROUBLESHO0_"."AREAID": ?????我是不是哪里配置错误了

解决方案 »

  1.   

    发现错误在哪里了。原来<property name="areaID" type="java.lang.Integer">
      <column name="AREA_OCA" precision="22" scale="0" />
      </property> 不能映射进来。。
    但是查询的时候 还是只查询TroubleshootCallLog(多的)表。。地址表不查询。。不知道为什么。。
    是不死 AREA_OCA字段有问题。。是不是要和AreaCode表里的字段一致。
      

  2.   

    地址表
      <id name="areaID" type="java.lang.Long">
                <column name="id" />
               <generator class="sequence" />
            </id>
            <property name="areaName" type="java.lang.String">
                <column name="AREA" length="1000" />
            </property>