`
eavesice
  • 浏览: 18682 次
  • 性别: Icon_minigender_1
  • 来自: 甘肃
最近访客 更多访客>>
社区版块
存档分类
最新评论

Hibernate:An association from the table Table refers to an unmapped class: Class

阅读更多

1.数据库结构

article: id、title、content ...

article_attachment: article_id、attachment_id

attachment: id、name、src ...

2.代码结构

article.java:

public class Article implements Serializable{

...

private Set<Attachment> attachments;

...

}

article.hbm.xml: 

...

<set

  name="attachments" 
  table="ARTICLE_ATTACHMENT" 
  cascade="all-delete-orphan" 
  lazy="false">
  <cache usage="read-write"/>
  <key column="ARTICLE_ID"/>
  <many-to-many 
  column="ATTACHMENT_ID" 
  class="Attachment"/>

</set>

... 

attachment.java

attachment.hbm.xml

3.错误代码

Caused by: org.hibernate.MappingException: An association from the table ARTICLE_ATTACHMENT refers to an unmapped class: Attachment

4.错误原因

A> hibernate.cfg.xml未加载Attachment.hbm.xml

B> Attachment.hbm.xml未实现

C> Attachment.hbm.xml的class未指定包(package)

3
1
分享到:
评论

相关推荐

    解决docker报错The push refers to a repository_docker load

    解决docker报错The push refers to a repository

    SSD7 选择题。Multiple-Choice

    (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...

    Docker push报错 :denied: requested access to the resource is denied

    在排除没有登录和网络的原因:我还是报的如下错误 原因镜像的名字没有按照...The push refers to repository [docker.io/langxuhao/my_redis] cd1b418d5a74: Pushed ddf2402ca3ea: Pushed 00352274272b: Pushed a0e3c

    鸢尾花数据

    where each class refers to a type of iris plant. One class is linearly separable from the other 2; the latter are NOT linearly separable from each other. --- Predicted attribute: class of iris ...

    hibernate-shards.jar

    d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility ...

    计算机组成与结构体系英文课件:Chapter 8 – The Memory System - 2

    There are two aspects to this principle: Temporal Locality refers to the likelihood that an item accessed recently will be accessed again soon. Spatial Locality, on the other hand, suggests that if ...

    C 程序设计教学课件:Chapter 3 class and object.ppt

    It refers to incorporating one class as a part of another, allowing the creation of complex objects from simpler ones. This promotes reusability and modularity in code design. Static members in C++ ...

    VisualFoxPro6.0中文版命令手册.pdf

    - **REST:** Refers to all records from the current record to the end of the table. - **FIELDS 字段名列表:** Specifies the fields (columns) on which the command operates. - **FOR 条件:** Executes the ...

    微软内部资料-SQL性能优化3

    holds an exclusive lock at the table level, and another transaction (T2) holds an exclusive lock at the row level, each of the transactions believe they have exclusive access to the resource....

    Docker push镜像失败解决方法

    The push refers to a repository [docker.io/lekkoliu/tomcat8] cefee3f6c961: Preparing 82f021d9c2b9: Preparing 4f91f02b4e49: Preparing a4b3ce7e1d4a: Preparing c3b95f8496f1: Preparing bcfb53b3ff7c: Wait

    An Imaginary Tale The Story Of I - Paul J Nahin

    At the very beginning of his book on i, the square root of minus one, Paul Nahin warns his readers: "An Imaginary Tale has a very strong historical component to it, but that does not mean it is a ...

    HX8264-D03-DS-v03.pdf

    Based on the provided information, it appears that there might have been a mix-up in the content, as the title and description seem unrelated to the actual document details provided, which focus on ...

    Progress/OpenEdge语言手册

    However, if at run time the passed dynamic temp-table schema does not match the schema of the static temp-table parameter, the AVM raises an error.” The following sentence refers to run-time actions...

    SniperCoding#The_sword_refers_to_offer#剑指 Offer 05. 替换空格1

    示例 1:输出:"We%20are%20happy."限制:0 的长度 解法想法:使用 StringBuilder遍历字符串如果遍历的

    计算机网络第六版答案

    An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...

    java英文笔试

    **Answer**: Multiple inheritance refers to a scenario where one class inherits from more than one class at the same time. While Java does not directly support multiple inheritance due to potential ...

    ILI9331AN_V0.2.pdf

    Based on the given information from "ILI9331AN_V0.2.pdf," we can extract several key points related to the ILI9331 a-Si TFT LCD single chip driver, which supports a resolution of 240RGBx320 and 262K ...

    SniperCoding#The_sword_refers_to_offer#剑指 Offer 10- I. 斐波那契数列1

    示例 1:输入:n = 2输出:1示例 2:输入:n = 5输出:5提示:解法想法:动态规划首先定义一个备忘录dp,数组中存储 n+1 个数,其中 dp[i]

    医学英语词根词缀大全.doc

    例如:auriscope:an instrument for examining the ear(检查耳朵用的耳镜) -eal:pertaining to,关于 例如:laryngeal:pertaining to the larynx(喉的,喉音的) -ia:condition;quality,状态;质量 例如...

Global site tag (gtag.js) - Google Analytics