• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hbm file mappings to access other tables from named queries

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All ,

Below hbm file is mapped to Person table , i have a below named query to access Event object but it is failing , inorder to access Event entity object in Person hbm file how can i do that. i want to do only in hbm file , there is no relation between event and person , your inputs are highly appreciated.



<query name="getDeleted"><![CDATA[
from Event evntSmryHdr where evntSmryHdr.schedStartDate >= :minCI and evntSmryHdr.schedStartDate <= :maxCI
and evntSmryHdr.loginUserId =:loginUserId and evntSmryHdr.whse =:whse and evntSmryHdr.laborTypeId = 5 and evntSmryHdr.source = 'MS' and evntSmryHdr.lastModBy = 'MS' order by evntSmryHdr.schedStartDate
]]></query>




<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.test.app.tap">
<class name="Person" table="E_INTERM_TA_STG">
<cache usage="nonstrict-read-write"/>
<property name="createDateTime" type="timestamp">
<column name="CREATE_DATE_TIME" length="23" />
</property>
<property name="modDateTime" type="timestamp">
<column name="MOD_DATE_TIME" length="23" />
</property>
<property name="userId" type="string">
<column name="USER_ID" />
</property>
</class>
<query name="getDeleted"><![CDATA[
from Event evntSmryHdr where evntSmryHdr.schedStartDate >= :minCI and evntSmryHdr.schedStartDate <= :maxCI
and evntSmryHdr.loginUserId =:loginUserId and evntSmryHdr.whse =:whse and evntSmryHdr.laborTypeId = 5 and evntSmryHdr.source = 'MS' and evntSmryHdr.lastModBy = 'MS' order by evntSmryHdr.schedStartDate
]]></query>


<query name="getBreakEnd"><![CDATA[
from Person stg
where stg.userId = :loginUserId
]]></query>

</hibernate-mapping>
 
Sireesh Ganagam
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sireesh Ganagam wrote:Hello All ,

Below hbm file is mapped to Person table , i have a below named query to access Event object but it is failing , inorder to access Event entity object in Person hbm file how can i do that. i want to do only in hbm file , there is no relation between event and person , your inputs are highly appreciated.



<query name="getDeleted"><![CDATA[
from Event evntSmryHdr where evntSmryHdr.schedStartDate >= :minCI and evntSmryHdr.schedStartDate <= :maxCI
and evntSmryHdr.loginUserId =:loginUserId and evntSmryHdr.whse =:whse and evntSmryHdr.laborTypeId = 5 and evntSmryHdr.source = 'MS' and evntSmryHdr.lastModBy = 'MS' order by evntSmryHdr.schedStartDate
]]></query>




<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.test.app.tap">
<class name="Person" table="E_INTERM_TA_STG">
<cache usage="nonstrict-read-write"/>
<property name="createDateTime" type="timestamp">
<column name="CREATE_DATE_TIME" length="23" />
</property>
<property name="modDateTime" type="timestamp">
<column name="MOD_DATE_TIME" length="23" />
</property>
<property name="userId" type="string">
<column name="USER_ID" />
</property>
</class>
<query name="getDeleted"><![CDATA[
from Event evntSmryHdr where evntSmryHdr.schedStartDate >= :minCI and evntSmryHdr.schedStartDate <= :maxCI
and evntSmryHdr.loginUserId =:loginUserId and evntSmryHdr.whse =:whse and evntSmryHdr.laborTypeId = 5 and evntSmryHdr.source = 'MS' and evntSmryHdr.lastModBy = 'MS' order by evntSmryHdr.schedStartDate
]]></query>


<query name="getBreakEnd"><![CDATA[
from Person stg
where stg.userId = :loginUserId
]]></query>

</hibernate-mapping>

 
Hey! Wanna see my flashlight? It looks like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic