my user
model class traditional following-
package org.ravij.model; public class user { private string username; private string password; private boolean isadmin; public boolean isadmin() { return isadmin; } public void setadmin(boolean isadmin) { this.isadmin = isadmin; } 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; } }
i getting below exception, while running hibernate v4.2-
caused by: org.hibernate.propertynotfoundexception: not find getter isadmin in class org.ravij.model.user @ org.hibernate.property.basicpropertyaccessor.creategetter(basicpropertyaccessor.java:316) @ org.hibernate.property.basicpropertyaccessor.getgetter(basicpropertyaccessor.java:310) @ org.hibernate.mapping.property.getgetter(property.java:321) @ org.hibernate.tuple.entity.pojoentitytuplizer.buildpropertygetter(pojoentitytuplizer.java:436) @ org.hibernate.tuple.entity.abstractentitytuplizer.<init>(abstractentitytuplizer.java:200) @ org.hibernate.tuple.entity.pojoentitytuplizer.<init>(pojoentitytuplizer.java:82)
below hibernate mapping configuration file-
<hibernate-mapping package="org.ravij.model"> <class name="user" table="users"> <id name="username" type="string" column="user_name" length="20"> <generator class="assigned" /> </id> <property name="password" type="string" column="password" /> <property name="isadmin" column="admin" type="boolean" /> </class> </hibernate-mapping>
why getting error "could not find getter boolean"
, changes required?
following javabean naming convention, property name "admin". "isadmin" name of accessor method property.
Comments
Post a Comment