还是SSH问题

fengzhizi715 2007-04-25 12:18:09
出现如下的错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: column attribute may not be used together with <column> subelement


看英文觉得是hibernate的hbm.xml文件配置问题


...全文
542 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fengzhizi715 2007-04-26
  • 打赏
  • 举报
回复
问题解决了
谢谢
fengzhizi715 2007-04-25
  • 打赏
  • 举报
回复
数据库的脚本如下:
create table Entries (
EntryId int not null auto_increment,

Subject varchar(50) not null,
Body text not null,
PostDate datetime not null,

constraint PK_EntryId primary key (EntryId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

create table Comments (
CommentId int not null auto_increment,

Subject varchar(50) not null,
Body text not null,
PostDate datetime not null,
Entry int not null,
ReplyTo int null,
PostedBy int null,

index (ReplyTo),
index (PostedBy),
index (Entry),

constraint PK_CommentId primary key (CommentId),
constraint FK_ReplyTo foreign key (ReplyTo) references Comments(CommentId) on delete cascade,
constraint FK_PostedBy foreign key (PostedBy) references Users(UserId) on delete cascade,
constraint FK_Entry foreign key (Entry) references Entries(EntryId) on delete cascade
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
fengzhizi715 2007-04-25
  • 打赏
  • 举报
回复
我把配置文件发出来,各位帮我看看那里错了

Comment.hbm.xml文件如下:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="model">

<class name="Comment" table="Comments">
<id name="commentId" column="CommentId" type="int" unsaved-value="0" >
<generator class="identity"/>
</id>

<property name="subject" column="Subject" type="string" length="50" not-null="true"/>
<property name="body" column="Body" type="string" not-null="true"/>
<property name="postDate" column="PostDate" type="java.util.Date" not-null="true"/>
<property name="entry" column="Entry" type="int" not-null="true"/>
<property name="replyTo" column="ReplyTo" type="int" not-null="false"/>
<many-to-one name="postedBy" class="model.User" column="PostedBy">
<column name="UserId"/>
</many-to-one>
</class>

</hibernate-mapping>


Entry.hbm.xml文件如下:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="Entry">

<class name="Entry" table="Entries">
<id name="entryId" column="EntryId" type="int" unsaved-value="0" >
<generator class="identity"/>
</id>

<property name="subject" column="Subject" type="string" length="50" not-null="true"/>
<property name="body" column="Body" type="string" not-null="true"/>
<property name="postDate" column="postDate" type="java.util.Date" not-null="true"/>
<set name="comments" table="Comments">
<key column="Entry"/>
<one-to-many class="model.Comment"/>
</set>
</class>

</hibernate-mapping>
bl_long1 2007-04-25
  • 打赏
  • 举报
回复
<many-to-one name="postedBy" class="model.User" column="PostedBy">
<column name="UserId"/>
</many-to-one>
这里不能同时使用column属性和column元素,两者取一即可。值为外键的那个列名。
歌曲长寿——为什么有些歌曲经久不衰 为什么一个轨道流了好几年,而一个更好的轨道在几周内就消失了?此数据集如下 45000首已发布的曲目——它们的音频特征、分布范围和流轨迹-- 令人不安的发现是:一首歌是如何被推送的,预示着它的寿命;它如何 听起来几乎没有。 标题:音频功能基本上无法解释一首曲目的3年流(R²≈0),而 发行——播放列表、营销、TikTok——和早期势头解释了其中的大部分。流媒体是 穿着创意服装的发行游戏。 45000条轨道·21列·3年流/慢燃烧器/命中目标 --- 为什么这个数据集 Kaggle有很多“Spotify音频功能”表,用于根据跳舞能力和 能量。他们大多发现微弱的信号,然后不说为什么。此数据集明确说明了原因: 它将音频功能与分布变量(播放列表位置、标签、营销、TikTok)配对 病毒性)和早期动量信号,因此您可以看到音频质量下降。 它再现的数字 -极度集中:前1%的轨道吸引了所有溪流的49%,前10%的溪流吸引了约84%的溪流 赢家通吃最多的现实(Luminate报告称,前1%的艺术家获得了约90%的完整流媒体 目录,其中包括约88%从未清除1000次播放的曲目)。 -半衰期短:中位轨道在其峰值的一半以上花费约50天——“大多数艺术家有两个 在歌曲褪色之前几个月才能赚钱。“只有约10%是慢燃烧器(半衰期>150天)。 -分发胜过音频:播放列表添加、编辑位置和TikTok病毒式传播都是相互关联的 ~0.3,3年流;音频特征(能量、效价、可跳舞性)相关系数约为0。 -马修效应:第一个月的流量与3年的早期动量相关约0.88 播放列表驱动了大约一半的收听,并放大了已经移动的曲目。 标题结果 预测日志3年流: |使用的功能|R²| |---|---| |仅音频(能量、效价、可跳舞性、节奏等)|≈0.00| |分发(播放列表、标签、营销、TikTok)|≈0

67,535

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧