这是后台打印出来的sql;(建了3个表) T_ApproveInfo (id number(10,0) not null, comment varchar2(255), approveTime date, document number(10,0), approver number(10,0), primary key (id))
10:11:45,953 ERROR SchemaUpdate:155 - Unsuccessful: create table T_ApproveInfo (id number(10,0) not null, comment varchar2(255), approveTime date, document number(10,0), approver number(10,0), primary key (id))
10:11:45,953 ERROR SchemaUpdate:156 - ORA-00904: : 无效的标识符10:11:45,953 DEBUG SchemaUpdate:149 - create table T_Workflow (id number(10,0) not null, name varchar2(255) unique, processDefinition long raw, processImage long raw, primary key (id))
10:11:45,984 ERROR SchemaUpdate:155 - Unsuccessful: create table T_Workflow (id number(10,0) not null, name varchar2(255) unique, processDefinition long raw, processImage long raw, primary key (id))
10:11:45,984 ERROR SchemaUpdate:156 - ORA-01754: 表只能包含一个 LONG 类型的列10:11:45,984 DEBUG SchemaUpdate:149 - alter table T_ApproveInfo add constraint FKAB3596101909ED74 foreign key (document) references T_Document
10:11:45,984 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_ApproveInfo add constraint FKAB3596101909ED74 foreign key (document) references T_Document
10:11:45,984 ERROR SchemaUpdate:156 - ORA-00942: 表或视图不存在10:11:45,984 DEBUG SchemaUpdate:149 - alter table T_ApproveInfo add constraint FKAB359610551FECCE foreign key (approver) references T_User
10:11:45,984 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_ApproveInfo add constraint FKAB359610551FECCE foreign key (approver) references T_User
10:11:45,984 ERROR SchemaUpdate:156 - ORA-00942: 表或视图不存在10:11:45,984 DEBUG SchemaUpdate:149 - alter table T_Document add constraint FK64B584C64BC90635 foreign key (creator) references T_User
10:11:46,015 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_Document add constraint FK64B584C64BC90635 foreign key (creator) references T_User
10:11:46,015 ERROR SchemaUpdate:156 - ORA-02267: 列类型与引用的列类型不兼容10:11:46,015 DEBUG SchemaUpdate:149 - alter table T_Document add constraint FK64B584C6B687FABC foreign key (workflow) references T_Workflow
10:11:46,015 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_Document add constraint FK64B584C6B687FABC foreign key (workflow) references T_Workflow
10:11:46,015 ERROR SchemaUpdate:156 - ORA-00942: 表或视图不存在

解决方案 »

  1.   

    无效的标识符 :comment是关键字,若要用做字段名,要加上双引号,比如"COMMENT"
    列类型与引用的列类型不兼容:主外键的类型要一致
    表只能包含一个 LONG 类型的列:这个提示得很清楚了
    表或视图不存在:检查下表或视图是否存在,如果是个同义词,引用别的用户下的表,查看是否有对应的权限
      

  2.   

    oracle一个表只能含一个long类型的列,明显你定义了2个processDefinition long raw, processImage long raw。所以建表失败,导致你增加外键约束时报“表或视图不存在”
      

  3.   

    T_ApproveInfo (id number(10,0) not null, comment varchar2(255), approveTime date, document number(10,0), approver number(10,0), primary key (id)) 
    10:11:45,953 ERROR SchemaUpdate:155 - Unsuccessful: create table T_ApproveInfo (id number(10,0) not null, comment varchar2(255), approveTime date, document number(10,0), approver number(10,0), primary key (id)) 
    10:11:45,953 ERROR SchemaUpdate:156 - ORA-00904: : 无效的标识符 这里的comment是关键字,要加双引号。即"comment"。这里建表不成功导致后面的几个错误10:11:45,953 DEBUG SchemaUpdate:149 - create table T_Workflow (id number(10,0) not null, name varchar2(255) unique, processDefinition long raw, processImage long raw, primary key (id)) 
    10:11:45,984 ERROR SchemaUpdate:155 - Unsuccessful: create table T_Workflow (id number(10,0) not null, name varchar2(255) unique, processDefinition long raw, processImage long raw, primary key (id)) 
    10:11:45,984 ERROR SchemaUpdate:156 - ORA-01754: 表只能包含一个 LONG 类型的列 这里很明显了,不能包含多个long类型10:11:45,984 DEBUG SchemaUpdate:149 - alter table T_ApproveInfo add constraint FKAB3596101909ED74 foreign key (document) references T_Document 
    10:11:45,984 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_ApproveInfo add constraint FKAB3596101909ED74 foreign key (document) references T_Document 
    10:11:45,984 ERROR SchemaUpdate:156 - ORA-00942: 表或视图不存在 T_ApproveInfo 在前面没有建成功导致10:11:45,984 DEBUG SchemaUpdate:149 - alter table T_ApproveInfo add constraint FKAB359610551FECCE foreign key (approver) references T_User 
    10:11:45,984 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_ApproveInfo add constraint FKAB359610551FECCE foreign key (approver) references T_User 
    10:11:45,984 ERROR SchemaUpdate:156 - ORA-00942: 表或视图不存在 T_ApproveInfo 在前面没有建成功导致10:11:45,984 DEBUG SchemaUpdate:149 - alter table T_Document add constraint FK64B584C64BC90635 foreign key (creator) references T_User 
    10:11:46,015 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_Document add constraint FK64B584C64BC90635 foreign key (creator) references T_User 
    10:11:46,015 ERROR SchemaUpdate:156 - ORA-02267: 列类型与引用的列类型不兼容 T_Document中的creator和T_User 中的creator类型不一致10:11:46,015 DEBUG SchemaUpdate:149 - alter table T_Document add constraint FK64B584C6B687FABC foreign key (workflow) references T_Workflow 
    10:11:46,015 ERROR SchemaUpdate:155 - Unsuccessful: alter table T_Document add constraint FK64B584C6B687FABC foreign key (workflow) references T_Workflow 
    10:11:46,015 ERROR SchemaUpdate:156 - ORA-00942: 表或视图不存在 T_Workflow 在前面没有建成功
      

  4.   

    用的Xdoclet建表:相关代码如下:1)
    /**
     * 审批历史信息
     * @author Administrator
     * @hibernate.class table="T_ApproveInfo"
     */
    public class ApproveInfo {

    /**
     * @hibernate.id
     *  generator-class="native"
     */
    private int id;

    /**
     * 审批意见
     * @hibernate.property
     *   column="comment"  
     */
    private String comment;
    2)/**
     * 流程
     * @author Administrator
     * @hibernate.class table="T_Workflow"
     */
    public class Workflow {

    /**
     * @hibernate.id
     *  generator-class="native"
     */
    private int id;

    /**
     * 流程名称
     * @hibernate.property
     *  unique="true"
     */
    private String name;

    /**
     * 流程定义文件
     * @hibernate.property
     *  type="binary"
     *  length="99999999"
     */
    private byte[] processDefinition;

    /**
     * 流程定义图片
     * @hibernate.property
     *  type="binary"
     *  length="99999999"
     */
    private byte[] processImage;
    不太清楚在这里咋改啊,那个comment加单引号,还有,我要定义,流程定义文件和流程定义图片,不用length(type="binary"
     *  length="99999999")真不知道用啥啊。
      

  5.   

    怎样使用Xdoclet给列名加上双引号啊