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)
分享到:
相关推荐
解决docker报错The push refers to a repository
(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...
在排除没有登录和网络的原因:我还是报的如下错误 原因镜像的名字没有按照...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 ...
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 ...
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 ...
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++ ...
- **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 ...
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....
The push refers to a repository [docker.io/lekkoliu/tomcat8] cefee3f6c961: Preparing 82f021d9c2b9: Preparing 4f91f02b4e49: Preparing a4b3ce7e1d4a: Preparing c3b95f8496f1: Preparing bcfb53b3ff7c: Wait
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 ...
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 ...
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...
示例 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 ...
**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 ...
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 ...
示例 1:输入:n = 2输出:1示例 2:输入:n = 5输出:5提示:解法想法:动态规划首先定义一个备忘录dp,数组中存储 n+1 个数,其中 dp[i]
例如:auriscope:an instrument for examining the ear(检查耳朵用的耳镜) -eal:pertaining to,关于 例如:laryngeal:pertaining to the larynx(喉的,喉音的) -ia:condition;quality,状态;质量 例如...