hibernate自动生成表出现 标识符无效 好心人帮帮我 我就15分都给了 15
createtablep_department(didnumber(10,0)notnull,dnamevarchar2(20char),descriptionvarch...
create table p_department (
did number(10,0) not null,
dname varchar2(20 char),
description varchar2(100 char),
primary key (did)
)
08:30:03,673 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
create table p_post (
pid number(10,0) not null,
pname varchar2(20 char),
description varchar2(100 char),
primary key (pid)
)
08:30:03,904 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
create table p_user (
uid number(10,0) not null,
username varchar2(20 char),
password varchar2(100 char),
sex varchar2(20 char),
phone varchar2(20 char),
email varchar2(20 char),
did number(10,0),
primary key (uid)
)
08:30:03,904 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: create table p_user (uid number(10,0) not null, username varchar2(20 char), password varchar2(100 char), sex varchar2(20 char), phone varchar2(20 char), email varchar2(20 char), did number(10,0), primary key (uid))
08:30:03,904 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00904: : 标识符无效
08:30:03,904 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
create table u_p (
pid number(10,0) not null,
uid number(10,0) not null,
primary key (uid, pid)
)
08:30:03,920 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: create table u_p (pid number(10,0) not null, uid number(10,0) not null, primary key (uid, pid))
08:30:03,920 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00904: : 标识符无效
08:30:03,920 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
alter table p_user
add constraint FKC4906A3A270A9485
foreign key (did)
references p_department
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: alter table p_user add constraint FKC4906A3A270A9485 foreign key (did) references p_department
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00942: 表或视图不存在
08:30:04,123 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
alter table u_p
add constraint FK1C326692813CF
foreign key (uid)
references p_user
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: alter table u_p add constraint FK1C326692813CF foreign key (uid) references p_user
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00904: : 标识符无效
08:30:04,123 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
alter table u_p
add constraint FK1C3266925ADDF
foreign key (pid)
references p_post
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: alter table u_p add constraint FK1C3266925ADDF foreign key (pid) references p_post 展开
did number(10,0) not null,
dname varchar2(20 char),
description varchar2(100 char),
primary key (did)
)
08:30:03,673 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
create table p_post (
pid number(10,0) not null,
pname varchar2(20 char),
description varchar2(100 char),
primary key (pid)
)
08:30:03,904 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
create table p_user (
uid number(10,0) not null,
username varchar2(20 char),
password varchar2(100 char),
sex varchar2(20 char),
phone varchar2(20 char),
email varchar2(20 char),
did number(10,0),
primary key (uid)
)
08:30:03,904 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: create table p_user (uid number(10,0) not null, username varchar2(20 char), password varchar2(100 char), sex varchar2(20 char), phone varchar2(20 char), email varchar2(20 char), did number(10,0), primary key (uid))
08:30:03,904 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00904: : 标识符无效
08:30:03,904 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
create table u_p (
pid number(10,0) not null,
uid number(10,0) not null,
primary key (uid, pid)
)
08:30:03,920 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: create table u_p (pid number(10,0) not null, uid number(10,0) not null, primary key (uid, pid))
08:30:03,920 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00904: : 标识符无效
08:30:03,920 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
alter table p_user
add constraint FKC4906A3A270A9485
foreign key (did)
references p_department
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: alter table p_user add constraint FKC4906A3A270A9485 foreign key (did) references p_department
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00942: 表或视图不存在
08:30:04,123 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
alter table u_p
add constraint FK1C326692813CF
foreign key (uid)
references p_user
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: alter table u_p add constraint FK1C326692813CF foreign key (uid) references p_user
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:349 - ORA-00904: : 标识符无效
08:30:04,123 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:377 -
alter table u_p
add constraint FK1C3266925ADDF
foreign key (pid)
references p_post
08:30:04,123 ERROR org.hibernate.tool.hbm2ddl.SchemaExport:348 - Unsuccessful: alter table u_p add constraint FK1C3266925ADDF foreign key (pid) references p_post 展开
3个回答
展开全部
uid数据库的关键字,建议修改成其他的关键字
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
表之间的关联出错了吧,你查下XML文件中配置外键有没有错。
我也不确定是不是支持 P_test 这样的命名,您注意下。
我也不确定是不是支持 P_test 这样的命名,您注意下。
追问
应该没有错,我用xml和annotation都试过了同样的结果 p_department p_post表在数据库已经有了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是创建好pojo对象,然后让hibernate自动生成表吗
更多追问追答
追问
没创建,只是有测试生成,之前写过同样的三张表能够自动生成
追答
是你先写好类和配置文件,然后反向生产表吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询