yes. when i was looking at this i thought about making the
dataprovider paging param ints, but then the long return type didnt
make sense.

since count() returns a long its feasible to request offsets in the
long range - eg user presses last page and you actually have more rows
then an int can hold.

so rather then going with a mixed approach that made the code base a
big mess i went with the biggest type everywhere, which is a long.

what i did at my day job is to create an entity data provider that
handles all these inconsistencies and castings and exposes a
consistent api to how our application works...

-igor

On Fri, May 3, 2013 at 8:58 AM, Paul Bors <[email protected]> wrote:
> All good and solid, but take for example Javax's Query API:
> http://docs.oracle.com/javaee/6/api/javax/persistence/Query.html#setFirstRes
> ult(int)
>
> Since Wicket's DataProvider now offers the first and count as longs, one
> would have to cast first to an int to pass it through the JEE 6 API, right?
> Or am I missing something?
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:[email protected]]
> Sent: Friday, May 03, 2013 11:45 AM
> To: [email protected]
> Subject: Re: Wicket 6.x and Repeaters API change to use longs
>
> 4.8.4 Aggregate Functions in the SELECT Clause The result of a query ...
>
> The Java type that is contained in the result of a query using an aggregate
> function is as follows:
> COUNT returns Long.
> ...
>
> -igor
>
> On Fri, May 3, 2013 at 8:35 AM, Paul Bors <[email protected]> wrote:
>> I'm a bit confused and can't find the JPA version that uses longs
>> instead of ints as mentioned in the migration guide at:
>>
>> https://cwiki.apache.org/WICKET/migration-to-wicket-60.html
>>
>> Repeaters
>>
>> *       `IDataProvider` was converted to using `long` instead of `int` to
>> better line up with JPA and other persistence frameworks. This has
>> caused a rather large cascade of `int` to `long` changes all over the
>> repeater packages (WICKET-1175
> <https://issues.apache.org/jira/browse/WICKET-1175> ).
>>
>>
>>
>> Could someone shed some light? I'm still using JEE 6 (as many of us)
>> and I don't feel comfortable casting a bunch of longs to int in my DAO
> code.
>>
>>
>>
>> ~ Thank you,
>>
>>     Paul Bors
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to