我的domain里面是这么写的 <union-subclass name="Topic" table=" wisdom_topic">
<property name="type" column="type_" />
<many-to-one name="forum" column="forumId_" lazy="false" />
<property name="summary" column="summary_" length="500" /> <property name="viewCount" column="viewCount_" />
<property name="replyCount" column="replyCount_" />
<!-- 这是一对一的关系,但把unique设为了false。
因为在sqlserver中运行时,有异常如下:
违反了 UNIQUE KEY 约束 'UQ__wisdom_topic__1367E606'。不能在对象 'dbo.wisdom_topic' 中插入重复键。 -->
<many-to-one name="lastReply" column="lastReplyId_" unique="false" lazy="false" /> <property name="lastArticlePostTime" column="lastArticlePostTime_" />
<property name="nextFloor" column="nextFloor_" />
</union-subclass>始终报错如下:23:35:25,125 [main] ERROR SchemaUpdate : Unsuccessful: create table wisdom_topic (id_ varchar(255) not null, title_ varchar(255), content_ text, authorId_ varchar(45), postTime_ datetime, ipAddr_ varchar(16), deleted_ bit, type_ varchar(255), forumId_ varchar(255), summary_ text, viewCount_ integer, replyCount_ integer, lastReplyId_ varchar(255), lastArticlePostTime_ datetime, nextFloor_ integer, primary key (id_)) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,125 [main] ERROR SchemaUpdate : Table 'wisdom_topic' already exists ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
23:35:25,125 [main] ERROR SchemaUpdate : Unsuccessful: alter table wisdom_topic add index FK56D80D5190BF431F (forumId_), add constraint FK56D80D5190BF431F foreign key (forumId_) references wisdom_forum (id_) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,125 [main] ERROR SchemaUpdate : Duplicate key name 'FK56D80D5190BF431F' ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
23:35:25,125 [main] ERROR SchemaUpdate : Unsuccessful: alter table wisdom_topic add index FK56D80D51F0AA1F15 (lastReplyId_), add constraint FK56D80D51F0AA1F15 foreign key (lastReplyId_) references wisdom_reply (id_) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,125 [main] ERROR SchemaUpdate : Duplicate key name 'FK56D80D51F0AA1F15' ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
23:35:25,140 [main] ERROR SchemaUpdate : Unsuccessful: alter table wisdom_topic add index FKDDDD4478AE4DB58956d80d51 (authorId_), add constraint FKDDDD4478AE4DB58956d80d51 foreign key (authorId_) references wisdom_user (id_) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,140 [main] ERROR SchemaUpdate : Duplicate key name 'FKDDDD4478AE4DB58956d80d51' ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
是个什么原因呢??不懂。每次看见控制台报错,头就很大。。学的不扎实。。还请各位赐教啊,,,,
<property name="type" column="type_" />
<many-to-one name="forum" column="forumId_" lazy="false" />
<property name="summary" column="summary_" length="500" /> <property name="viewCount" column="viewCount_" />
<property name="replyCount" column="replyCount_" />
<!-- 这是一对一的关系,但把unique设为了false。
因为在sqlserver中运行时,有异常如下:
违反了 UNIQUE KEY 约束 'UQ__wisdom_topic__1367E606'。不能在对象 'dbo.wisdom_topic' 中插入重复键。 -->
<many-to-one name="lastReply" column="lastReplyId_" unique="false" lazy="false" /> <property name="lastArticlePostTime" column="lastArticlePostTime_" />
<property name="nextFloor" column="nextFloor_" />
</union-subclass>始终报错如下:23:35:25,125 [main] ERROR SchemaUpdate : Unsuccessful: create table wisdom_topic (id_ varchar(255) not null, title_ varchar(255), content_ text, authorId_ varchar(45), postTime_ datetime, ipAddr_ varchar(16), deleted_ bit, type_ varchar(255), forumId_ varchar(255), summary_ text, viewCount_ integer, replyCount_ integer, lastReplyId_ varchar(255), lastArticlePostTime_ datetime, nextFloor_ integer, primary key (id_)) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,125 [main] ERROR SchemaUpdate : Table 'wisdom_topic' already exists ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
23:35:25,125 [main] ERROR SchemaUpdate : Unsuccessful: alter table wisdom_topic add index FK56D80D5190BF431F (forumId_), add constraint FK56D80D5190BF431F foreign key (forumId_) references wisdom_forum (id_) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,125 [main] ERROR SchemaUpdate : Duplicate key name 'FK56D80D5190BF431F' ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
23:35:25,125 [main] ERROR SchemaUpdate : Unsuccessful: alter table wisdom_topic add index FK56D80D51F0AA1F15 (lastReplyId_), add constraint FK56D80D51F0AA1F15 foreign key (lastReplyId_) references wisdom_reply (id_) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,125 [main] ERROR SchemaUpdate : Duplicate key name 'FK56D80D51F0AA1F15' ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
23:35:25,140 [main] ERROR SchemaUpdate : Unsuccessful: alter table wisdom_topic add index FKDDDD4478AE4DB58956d80d51 (authorId_), add constraint FKDDDD4478AE4DB58956d80d51 foreign key (authorId_) references wisdom_user (id_) ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155)
23:35:25,140 [main] ERROR SchemaUpdate : Duplicate key name 'FKDDDD4478AE4DB58956d80d51' ==> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156)
是个什么原因呢??不懂。每次看见控制台报错,头就很大。。学的不扎实。。还请各位赐教啊,,,,
解决方案 »
- 做了个界面,怎么tomcat启动后,访问的时候老是报页面另存为
- java web 项目如何做到:让更新升级更简单
- 菜鸟 关于 Vector 以及 Arraylist 的用法问题,请各路高手瞅瞅~~~~~~
- 一个仓库管理系统中,时间矫正的问题?????(急)
- 由proxool引起的死循环问题
- 为什么tomcat无法找到我自己定义的包?
- 问:如何在点击按钮后,执行一个action后,回到本页面,能把隐藏的表格显示出来!!!
- 在jsp页面中,javascript里面的参数能不能在jsp代码中使用?
- 在js中使用jstl 自定义函数中传值,但是始终不成功
- 数据抽取问题
- QR code 儲值問題
- java 规律数组 找出 每个索引间的 缺失的值
提示表wisdom_topic已经存在了