org.hibernate.exception.GenericJDBCException: could not load an entity: [com.cartif.database.Role#Project]
I am developing with Hibernate. So, when I want to load a eentity, I get an error like:
org.hibernate.exception.GenericJDBCException: could not load an entity: [com.cartif.database.Role#Project]
My hibernate mapping file is:
<hibernate-mapping>
<class name="com.cartif.database.Role" table="Role">
<id column="name" name="name" type="java.lang.String"/>
<property column="permission" generated="never" lazy="false" name="permission" type="java.lang.Integer"/>
</class>
</hibernate-mapping>
And the call on session is:
(Role)DatabaseManager.loadObject(Role.class, loadUser(login).getRole())
public static Object loadObject(Class o, String id){
if(session == null) createSession();
return session.get(o, i开发者_如何学Cd);
}
I have checked the package and the name of table, but they are OK! What could the problem be?
Thanks!
Regards!
Sorry, the user which I have connected does not have permission. I add grants to user in database and it runs!
精彩评论