Hello,
I am trying to find an element by it's id. However it hibernate is raising the exception
org.hibernate.MappingException: Unknown entity: mypackage.common.InterfaceAssignmentDef. Now I use the following code to retrieve an AssignmentDef from it's Id.
Code:
@SuppressWarnings("unchecked")
public T findById(ID id, boolean lock) {
T entity;
if (lock){
entity = (T) getSession().load(getPersistentClass(), id, LockMode.UPGRADE);
}
else{
entity = (T) getSession().load(getPersistentClass(), id);
}
return entity;
}
I had copied this code from an example I had seen on this same website. Now this code works fine for other objects without any problems (Assignments, Schools, etc) However it seems to give a problem on this particular class.
The only difference in this class is that this class (AssignmentsDef) has a List object containing the a list of objects of type Assignment. Then there is another object of type Class that has a List of type Assignment. Therefore the assignment class is like a link table in databases.
Now I searched on the internet and I foound out that it could be from the mapping file not being found. I searched for the mapping file inside the War file and I found it.
I also find a post here talking about a bug that was solved in 3.1, however I downloeaded this and I still could have this problem :(
I do not know what to do next since the code is practically the same as in other classes I have.
thanks and regards,
kcorp