This work fine in Oracle
[Test]
public void SimplePagination()
{
using (ISession session = OpenSession())
using (ITransaction t = session.BeginTransaction())
{
session.Save(new Student {Name = "Mengano", StudentNumber = 232});
session.Save(new Student {Name = "Ayende", StudentNumber = 999});
session.Save(new Student {Name = "Fabio", StudentNumber = 123});
session.Save(new Student {Name = "Merlo", StudentNumber = 456});
session.Save(new Student {Name = "Fulano", StudentNumber = 0});

t.Commit();
}

using (ISession session = OpenSession())
using (ITransaction t = session.BeginTransaction())
{
var result = session.CreateCriteria<Student>()
.Add(Restrictions.Gt("StudentNumber", 0L))
.AddOrder(Order.Asc("StudentNumber"))
.SetFirstResult(1).SetMaxResults(2)
.List<Student>();
Assert.That(result.Count, Is.EqualTo(2));
Assert.That(result[0].StudentNumber, Is.EqualTo(232));
Assert.That(result[1].StudentNumber, Is.EqualTo(456));

t.Commit();
}

using (ISession session = OpenSession())
using (ITransaction t = session.BeginTransaction())
{
session.CreateQuery("delete from Student").ExecuteUpdate();
t.Commit();
}
}

and this is the query
select
        *
    from
        ( select
            row_.*,
            rownum rownum_
        from
            ( SELECT
                this_.studentId as studentId1_0_,
                this_.Name as Name1_0_,
                this_.preferredCourseCode as preferre3_1_0_
            FROM
                Student this_
            WHERE
                this_.studentId > :p0
            ORDER BY
                this_.studentId asc ) row_
        where
            rownum <=:p1
        )
    where
        rownum_ >:p2;
    :p0 = 0, :p1 = 3, :p2 = 1

2009/5/29 Fabio Maulo <[email protected]>

> Please try to recreate the issue and post it in a new JIRA ticket.Thanks.
>
> 2009/5/29 Shane C <[email protected]>
>
>
>> #NH-1540 seems to be related to this problem but based on it this
>> should be working.
>>
>> On May 29, 9:32 am, Shane C <[email protected]> wrote:
>> > Has anyone ran into a problem where the Oracle9i dialect creates a
>> > query like this?
>> >
>> >                                        select *
>> >                                        from   (select row_.*,
>> >                                                       rownum rownum_
>> >                                                from   (SELECT
>> > series1_.BT_SERIES_ID as y0_
>> >                                                        FROM
>> > BUSINESS_TRANSACTION this_0_,
>> >
>> > BT_SERIES series1_
>> >                                                        WHERE
>> > this_0_.BT_SERIES_ID = series1_.BT_SERIES_ID (+)) row_
>> >                                                where  rownum <= :p0)
>> >                                        where  rownum_ > :p1
>> >
>> > and does not provide a p0 or p1 value which causes an exception of
>> > type:
>> >
>> > System.Data.OracleClient.OracleException: ORA-01008: not all variables
>> > bound
>> >
>> > My query uses the following:
>> >
>> > selectCriteria.SetFirstResult(2)
>> >                     .SetMaxResults(1);
>> >
>> > I'm running 2.1.0 Alpha3.  I'll take a peek at the source code to see
>> > if I can figure it out but in the mean time I figured I'd check if
>> > anyone else has the same problem?
>> >>
>>
>
>
> --
> Fabio Maulo
>



-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to