Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.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
Oracle 无效的标识符-只有部分表名处于休眠状态_Oracle_Hibernate - Fatal编程技术网

Oracle 无效的标识符-只有部分表名处于休眠状态

Oracle 无效的标识符-只有部分表名处于休眠状态,oracle,hibernate,Oracle,Hibernate,当我执行查询以在Hibernate中保存对象时-生成的查询是错误的-下面是Hibernate生成的查询- select sintranhis_.SINID, sintranhis_.SINDDT as SINDDT3_, sintranhis_.SINDES as SINDES3_, sintranhis_.SINTIME as SINTIME3_, sintranhis_.SINTNO as SINTNO3_ from ERPDSS3.SINTRAN_HISTORY sintranhis_

当我执行查询以在Hibernate中保存对象时-生成的查询是错误的-下面是Hibernate生成的查询-

select sintranhis_.SINID, sintranhis_.SINDDT as SINDDT3_, sintranhis_.SINDES as SINDES3_, sintranhis_.SINTIME as SINTIME3_, sintranhis_.SINTNO as SINTNO3_ from ERPDSS3.SINTRAN_HISTORY  sintranhis_ where sintranhis_.SINID=?
下面是辛特拉大学的历史课-

public class SottranHistory extends Persistent_Model implements java.io.Serializable {


     private SottranHistoryId id;
     private Stpmast stpmast;
     private String sotdes;
     private BigDecimal sottno;
     private Date sotddt;
     private Timestamp sottime;

    public SottranHistory() {
    }


    public SottranHistory(SottranHistoryId id, Stpmast stpmast) {
        this.id = id;
        this.stpmast = stpmast;
    }
    public SottranHistory(SottranHistoryId id, Stpmast stpmast, String sotdes, BigDecimal sottno, Date sotddt, Timestamp sottime) {
       this.id = id;
       this.stpmast = stpmast;
       this.sotdes = sotdes;
       this.sottno = sottno;
       this.sotddt = sotddt;
       this.sottime = sottime;
    }

     @EmbeddedId


    @AttributeOverrides( {
        @AttributeOverride(name="sottyp", column=@Column(name="SOTTYP", nullable=false, length=12) ), 
        @AttributeOverride(name="sotid", column=@Column(name="SOTID", nullable=false, precision=6, scale=0) ) } )
    public SottranHistoryId getId() {
        return this.id;
    }

    public void setId(SottranHistoryId id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SOTTYP", nullable=false, insertable=false, updatable=false)
    public Stpmast getStpmast() {
        return this.stpmast;
    }

    public void setStpmast(Stpmast stpmast) {
        this.stpmast = stpmast;
    }


    @Column(name="SOTDES", length=70)
    public String getSotdes() {
        return this.sotdes;
    }

    public void setSotdes(String sotdes) {
        this.sotdes = sotdes;
    }


    @Column(name="SOTTNO", precision=22, scale=0)
    public BigDecimal getSottno() {
        return this.sottno;
    }

    public void setSottno(BigDecimal sottno) {
        this.sottno = sottno;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="SOTDDT ", length=7)
    public Date getSotddt() {
        return this.sotddt;
    }

    public void setSotddt(Date sotddt) {
        this.sotddt = sotddt;
    }

    @Column(name="SOTTIME")
    public Timestamp getSottime() {
        return this.sottime;
    }

    public void setSottime(Timestamp sottime) {
        this.sottime = sottime;
    }
}
错误碰巧是-

SEVERE: ORA-00904: "SINTRANHIS_"."SINID": invalid identifier

Jul 25, 2012 11:25:36 AM com.dchan.codelion.models.Persistent_Model attachDirty
SEVERE: attach failed
org.hibernate.exception.SQLGrammarException: could not retrieve snapshot: [com.dchan.codelion.models.SintranHistory#1]

最后发现列名中有一个空格。修好后,一切正常