Re: Long primary keys

2019-11-15 Thread Vemund Jakobsen
ov 14, 2019, at 11:20 AM, Vemund Jakobsen wrote: > > > > If I have tables with long primary keys, how does Cayenne resolve the type > > of the foreign keys? Does the type have to be specified in the generated > > map file by using obj-attribute? > > The map file I have con

Re: Long primary keys

2019-11-14 Thread Andrus Adamchik
e through moderation. I hope you didn't miss the earlier replies). Andrus > On Nov 14, 2019, at 11:20 AM, Vemund Jakobsen wrote: > > If I have tables with long primary keys, how does Cayenne resolve the type of > the foreign keys? Does the type have to be specified in the generat

Re: Long primary keys

2019-11-14 Thread Vemund Jakobsen
If I have tables with long primary keys, how does Cayenne resolve the type of the foreign keys? Does the type have to be specified in the generated map file by using obj-attribute? The map file I have contains the below entry and it works if I do a GET request via API. If I do a GET request

Re: Long primary keys

2019-11-13 Thread Michael Gentry
I also totally missed IntegerType in the stack trace. 😕 On Wed, Nov 13, 2019 at 8:42 AM Michael Gentry wrote: > Hi Andrus, > > I was basing my response due to the "Numeric Overflow" exception, which > sounds like a number too big to fit into a Long. If a BIGINT/BigInteger > will work, that's

Re: Long primary keys

2019-11-13 Thread Michael Gentry
Hi Andrus, I was basing my response due to the "Numeric Overflow" exception, which sounds like a number too big to fit into a Long. If a BIGINT/BigInteger will work, that's the easiest solution. On Wed, Nov 13, 2019 at 8:35 AM Andrus Adamchik wrote: > This still does not invalidate the origin

Re: Long primary keys

2019-11-13 Thread Andrus Adamchik
This still does not invalidate the original question though - why wouldn't Cayenne choose a Long here? My suggestion is to map this column as BIGINT in Cayenne, and it will do the right thing. Andrus > On Nov 13, 2019, at 4:29 PM, Michael Gentry wrote: > > Hi Vemund! > > Long.MAX_VALUE is

Re: Long primary keys

2019-11-13 Thread Michael Gentry
Hi Vemund! Long.MAX_VALUE is 9,223,372,036,854,775,807. NUMBER(38) is a lot more digits. Does your DB really have primary keys that large? To play Devil's Advocate: 9223372036854775807 / 1000 inserts/second / 60 seconds/minute / 60 minutes/hour / 24 hours/day / 365 days/year = 292,471,208 year

Long primary keys

2019-11-13 Thread Vemund Jakobsen
Hi, I'm running a Oracle database and trying to get Cayenne to work when having primary keys that should be mapped to Long in Java. The data type in Oracle is NUMBER(38), but when I create a SelectQuery and use DlpObject object= (DlpObject) Cayenne.objectForQuery(ctx, this); to get the object,