hello friends,
In am getting an error while retreiving a record from Database. Can any one tel me where i am doing mistake.
Code:
org.hibernate.hql.ast.QuerySyntaxException: emp is not mapped [select pwd from emp where uid='aaaaaaaa']
here emp is my table name the mapping is as follows..
Code:
<hibernate-mapping>
<class name="login.form.RegisterForm" table="emp">
<id name="uid" column="uid" type="java.lang.String"></id>
<property name="pwd1" column="pwd" type="java.lang.String"/>
<property name="email" column="email" type="java.lang.String"/>
</class>
<class name="login.form.LoginForm" table="emp">
<id name="uid" column="name" type="java.lang.String"></id>
</class>
</hibernate-mapping>
my code in ActionClass is as follows
Code:
try
{
String userName = name;
org.hibernate.Transaction tx = session.beginTransaction();
String dbPwdCheck = "select uid from emp where uid='"+userName+"'";
session.createQuery(dbPwdCheck);
String LFormPwd = LForm.getPwd();
tx.commit();
session.flush();
session.close();
}
catch (Exception e)
{
System.err.println (e);
}
thx for anykind of help.
Ajay