为什么hibernate在映射时会出现错误的字段名称?

时间:2015-05-12 21:54:56

标签: hibernate grails gorm

我收到了这条消息:

Message: Invalid column name 'tftire_siteid'.

我有两个班级:

class TFTire implements Serializable {

    static hasMany = [ propertyList : TFTireProperty ]

    static mapping = {
        version false
        table 'TF_TIRE'
        id composite:['siteID','idRec'], generator: "assigned"

这一个:

class TFTireProperty implements Serializable {

    TFTire tfTire
    static belongsTo = [ TFTire ]

     static mapping = {
        version false
        table 'TF_TireProperty'
        id composite:['siteID','idRec'], generator: "assigned"

我的hibernate正在这样查询:

Hibernate: 
select propertyli0_.**tftire_**siteid as tftire5_1_1_,
propertyli0_.**tftire_**id_rec as tftire6_1_1_, propertyli0_.SiteID as SiteID1_,
propertyli0_.IDRec as IDRec1_, propertyli0_.SiteID as SiteID0_0_,
propertyli0_.IDRec as IDRec0_0_, propertyli0_.FullName as FullName0_0_,
propertyli0_.ShortName as ShortName0_0_, propertyli0_.tftire_siteid as tftire5_0_0_,
propertyli0_.tftire_id_rec as tftire6_0_0_, propertyli0_.TP as TP0_0_
from TF_TireProperty propertyli0_
where propertyli0_.**tftire_siteid**=?
  and propertyli0_.**tftire_id_rec**=?

它应该只是.siteid和idrec。没有下划线,也没有名字。

0 个答案:

没有答案