---
title: "【转】An association from the table * refers to an unmapped class: *"
author: "wangyanlong0107"
date: "2015-04-08T10:13:33Z"
tags: []
categories: ["企业架构"]
slug: "an-association-from-the-table-refers-to-an-unmapped-class"
draft: false
lastmod: "2015-04-08T10:13:33Z"
id: 2200172
url: "https://bigdragon.iteye.com/blog/2200172"
---

解决方法：  
class路径没写正确。  
有三个地方需要注意  
1、&lt;hibernate-mapping package=""&gt;  
2、&lt;class name="com.model.RoleInfo"&gt;  
3、&lt;set name="userInfos" table="ROLEOFUSER" inverse="false"&gt;  
            &lt;key column="ROLEID"&gt;  
            &lt;/key&gt;  
            &lt;many-to-many column="USERID" class="com.model.UserInfo" /&gt;  
        &lt;/set&gt;  
          
          
        建议：最好写在第一个地方，这样下面就可以不用写很长的包名了