How to use the batch mechanism in this query:
IList result = test.session.CreateQuery("from TestRemonts").List();// CreateCriteria(typeof(TestRemonts)).List();
This collection loaded with one select all.
How to make query for use in batch-mode (for 10 results in query) in this code:
Code:
foreach (TestRemonts data in result)
{
... //batch-size using there
}
Hibernate version: 1.2
Mapping documents:Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true" namespace="KRS" assembly="Persistent">
<class name="TestRemonts" table="TEST_REMONTS" lazy="true" batch-size="2" >
<id name="IdRem" column="ID_REM" type="Decimal" unsaved-value="0">
<generator class="assigned"/>
</id>
<property column="NAME_YKPG" type="String" name="NameYkpg" length="50" />
<property column="ID_KUST" type="String" name="IdKust" length="100" />
<property column="UWI" type="String" name="Uwi" length="10" />
</class>
</hibernate-mapping>