Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stored proc calling exception: org hibernate MappingException: Unknown entity:

 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to call the stored proc through hibernate (& spring), but getting the following exception. Surprisingly , if I use another class present in the same package , it is working.(There are exceptions as the mappings are not related to the another class, but the class is recognized by the hibernate.) Can anybody help me to get out of this? Why the class is not recognized by hibernate?(I am using hibernate 3). I have tried with fully qualified name as well as only class name, but no luck.




Here is my xml file code:


My java class is as :
[code]
package com.domain;

import java.util.Date;


public class SrUserReportResultData {

......java class with the attributes & getters-setters
}
[/class]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, it seems that the SrUserReportResultData class is used in a query, or is part of the result, and is mapped to a table, but the class itself either isn't part of the configuration, so it is never treated as a Hibernate entity. Make sure it's in the mapping file!

-Cameron McKenzie
 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah thanks, I did that & it worked. I have added following in the mapping file. Note that <id ...> tag is IMP otherwise , it will not work.(I faced same exception w/o this tag.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic