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>
|