java - Exception, table not mapped -


when run command in mysql prompt works properly.

select d.lastupdateddate,c.phonenumber1,d.simimea1, d.simimea2,d.model,c.latitude,  c.longitude  connectiondetails c inner join devicedetails d  on (c.deviceuniqueidentity = d.deviceuniqueidentity , d.rowstatus='0') 

exception

exception in thread "main" org.hibernate.hql.internal.ast.querysyntaxexception: connectiondetails not mapped [select d.lastupdateddate,c.phonenumber1,d.simimea1, d.simimea2,d.model,c.latitude,  c.longitude  connectiondetails c inner join devicedetails d  on (c.deviceuniqueidentity = d.deviceuniqueidentity , d.rowstatus='0')]     @ org.hibernate.hql.internal.ast.querysyntaxexception.generatequeryexception(querysyntaxexception.java:96)     @ org.hibernate.queryexception.wrapwithquerystring(queryexception.java:120) 

connectiondetails.hbm

<hibernate-mapping>     <class name="com.mypackage.cconnectiondetails"         table="connectiondetails">         <id name="connectionuniqueidentity" type="java.lang.string">             <column name="connectionuniqueidentity" />             <generator class="assigned" /> 

edit :

query query = currentsession().createsqlquery(sql); 

i changed code

query query = currentsession().createsqlquery(sql); 

to

query query = currentsession().createquery(sql); 

and worked.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -