-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: What is the use of 'loader query-ref="..."' element
PostPosted: Mon Jul 02, 2012 12:56 am 
Newbie

Joined: Thu Feb 11, 2010 9:02 pm
Posts: 3
Hi,
Could somebody please explain what is the use of <loader query-ref="alarms"/>
element in the definition file below? I can use:
Session session = ….
Query q = session.getNamedQuery("alarms");
List<DbOmnicastAlarm> alarms = q.list();

to get all DbOmnicastAlarm objects in one go.
So if I put <loader query-ref="alarms"/> element inside the class element – what more can I do with it. Is there any way of getting hold of some loader object and load all elements in one go or it has some different usage.
Thanks for the help,
Regards,
Janusz


<?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>
<class name="com.tycoint.penlink.omnicast.cameramonitor.service.DbOmnicastAlarm">
<id column="id" type="integer">
<generator class="assigned"/>
</id>
<property name="name"/>
<property name="entitysourceid"/>
<property name="lost"/>
<property name="lostTime"/>
<property name="recovered"/>
<loader query-ref="alarms"/>
</class>
<sql-query name="alarms">
<return alias="ams" class="com.tycoint.penlink.omnicast.cameramonitor.service.DbOmnicastAlarm" lock-mode="upgrade"/>
select ….
</sql-query>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: What is the use of 'loader query-ref="..."' element
PostPosted: Wed Jul 04, 2012 4:23 am 
Newbie

Joined: Wed Jul 04, 2012 4:16 am
Posts: 2
thanks dear i like it.....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.