Re: Custom PK and Pagination

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Feb 26 2010 - 08:53:40 EST

  • Next message: Marco Gattei: "cgen task"

    I would also recommend trying it with Cayenne 3.0, as the pagination
    code in 3.0 was significantly rewritten.

    Andrus

    On Feb 26, 2010, at 3:35 PM, Michael Gentry wrote:

    > I used custom PKs (and a custom PK generator) on a previous project
    > that was based upon Cayenne 2.0. My PKs were 96-bit binary, so I'm
    > sure a 16-bit binary would work. I never tried pagination, though.
    >
    > Are you sure you are having a problem with pagination? Your SELECT
    > statement only shows 2 IDs, but I suppose your list could be small.
    >
    > mrg
    >
    >
    > On Fri, Feb 26, 2010 at 6:09 AM, Sudheer <sudheer.tec..mail.com>
    > wrote:
    >>
    >> I have created custom type in Java by extending AbstractType and
    >> added same
    >> to existing types (SQL Server). This is the primary key. Java type is
    >> CustomUuid and DB type is Binary (16). Also I am performing select
    >> operation. Everything worked fine till I started using pagination.
    >> I got
    >> below error when I used pagination
    >>
    >> INFO QueryLogger: SELECT t0.amstat, t0.aorigin, t0.col1, t0.col2,
    >> t0.col3,
    >> t0.col4, t0.id, t0.label, t0.lrundate, t0.ptstat, t0.rcstat,
    >> t0.sdstat,
    >> t0.state, t0.tlevel, t0.usage_list FROM allcomputers t0 WHERE
    >> (t0.id = ?) OR
    >> (t0.id = ?) [bind: [com.xx.cayenne.util.CustomUuid:
    >> b06a638b06cca449bffd7049cc389847], [com.xx.cayenne.util.CustomUuid:
    >> 771a7f8b57006744b47d541bd5a796a5]]
    >> INFO QueryLogger: *** error.
    >> com.microsoft.sqlserver.jdbc.SQLServerException: The Java type
    >> com.ca.cayenne.util.CustomUuid is not a supported type.
    >> at
    >> com
    >> .microsoft
    >> .sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown
    >> Source)
    >> Exception in thread "main"
    >> org.apache.cayenne.CayenneRuntimeException:
    >> [v.2.0.4 October 8 2007] Query exception.
    >> at
    >> com.microsoft.sqlserver.jdbc.AppDTVImpl
    >> $SetValueOp.executeDefault(Unknown
    >> Source)
    >> at com.microsoft.sqlserver.jdbc.DTV.executeOp(Unknown
    >> Source).............................
    >>
    >> Am I missing something here???
    >>
    >> Is pagination allowed when Custom type is set as primary key?
    >>
    >> I am using Cayenne 2.0 (latest). Thanks in advance.
    >>
    >> --
    >> View this message in context: http://n3.nabble.com/Custom-PK-and-Pagination-tp417066p417066.html
    >> Sent from the Cayenne - User mailing list archive at Nabble.com.
    >>
    >



    This archive was generated by hypermail 2.0.0 : Fri Feb 26 2010 - 08:54:15 EST