2012-01-17 97 views
0

用SpringMVC中在src/main/resources我有我的hibernate.cfg.xml休眠用SpringMVC「MappingNotFoundException」

我有一個類,是我的模型src/main/javaorg.david.model.UserDetails.java如下粘貼。

@Entity 
public class UserDetails { 

    @Id 
    private int userId; 
    private String username; 
    private String password; 

    public int getUserId() { 
     return userId; 
    } 
    public void setUserId(int userId) { 
     this.userId = userId; 
    } 
    public String getUsername() { 
     return username; 
    } 
    public void setUsername(String username) { 
     this.username = username; 
    } 
    public String getPassword() { 
     return password; 
    } 
    public void setPassword(String password) { 
     this.password = password; 
    } 


} 

每當我跑我的項目,它擊中創建我得到一個

org.hibernate.MappingNotFoundException會議代碼:資源:找不到org.david.model.UserDetails

映射到該文件是在我的hibernate.cfg.xml線...

<mapping resource="org.david.model.UserDetails"/> 

我錯過了什麼嗎?

回答