Re: Ordering objects by primary keys

2021-10-30 Thread Michael Gentry
I had 100% forgotten about MarkMail -- thanks for the reminder! On Sat, Oct 30, 2021 at 4:09 AM Aristedes Maniatis wrote: > Its old, but still fast and works well: > https://markmail.org/search/?q=list%3Aorg.apache.cayenne.user+%22db%3A%22 > > Ari > > > On 30/10/21 1:01am, Michael Gentry wrote:

Re: Ordering objects by primary keys

2021-10-30 Thread Aristedes Maniatis
Its old, but still fast and works well: https://markmail.org/search/?q=list%3Aorg.apache.cayenne.user+%22db%3A%22 Ari On 30/10/21 1:01am, Michael Gentry wrote: Fun fact: I have years worth of Cayenne mailing list content in GMail, but you can't search for db: in it because GMail uses prefix:t

Re: Ordering objects by primary keys

2021-10-29 Thread Michael Gentry
Fun fact: I have years worth of Cayenne mailing list content in GMail, but you can't search for db: in it because GMail uses prefix:term as an advanced search option and it doesn't know what to do with db: ... On Thu, Oct 28, 2021 at 2:38 AM giulio.ces...@gmail.com < giulio.ces...@gmail.com> wrot

Re: Ordering objects by primary keys

2021-10-27 Thread giulio.ces...@gmail.com
My bad for missing it. 😕 Thanks for the reference; I will dig a little deeper into the AWESOME documentation. "Unfortunately", Cayenne is so smooth to use that I need to read the documentation so rarely, that I have missed most of the updates since 3.1 (the first release of Cayenne I started using

Re: Ordering objects by primary keys

2021-10-27 Thread Andrus Adamchik
Yeah, the expressions chapter mentions it: http://cayenne.apache.org/docs/4.1/cayenne-guide/#expressions Andrus > On Oct 28, 2021, at 9:38 AM, giulio.ces...@gmail.com wrote: > > Is there any point in the documentation where thi

Re: Ordering objects by primary keys

2021-10-27 Thread giulio.ces...@gmail.com
Is there any point in the documentation where this "db:" prefix has been documented? Cheers, Giulio Cesare On Wed, Oct 27, 2021 at 11:23 PM giulio.ces...@gmail.com < giulio.ces...@gmail.com> wrote: > It did work! 🤩 > > Thanks Nikita. 🙏 > > Cheers, > > Giulio Cesare > > > On Wed, Oct 27, 2021 at

Re: Ordering objects by primary keys

2021-10-27 Thread giulio.ces...@gmail.com
It did work! 🤩 Thanks Nikita. 🙏 Cheers, Giulio Cesare On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev wrote: > Hi! > > You could try to add "db:" prefix to the primary key name. > Something like this: orderBy("db:ARTIST_ID") > > On Wed, Oct 27, 2021 at 8:14 PM giulio.ces...@gmail.com > wrot

Re: Ordering objects by primary keys

2021-10-27 Thread Nikita Timofeev
Hi! You could try to add "db:" prefix to the primary key name. Something like this: orderBy("db:ARTIST_ID") On Wed, Oct 27, 2021 at 8:14 PM giulio.ces...@gmail.com wrote: > > Hello, > > I am try to run some BBD tests integrated with Cayenne (succesfully, so > far). > I am at the point where I ca

Ordering objects by primary keys

2021-10-27 Thread giulio.ces...@gmail.com
Hello, I am try to run some BBD tests integrated with Cayenne (succesfully, so far). I am at the point where I can not fully specify the record/object to select in the test script, and so I am trying to select the latest object inserted, matching some lose criteria. Unfortunately, I don't have a

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
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
wrote: > > > > 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 / 6

Re: Long primary keys

2019-11-13 Thread Andrus Adamchik
> 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 / 36

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,47

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 o

Compound primary keys and setting a null object in relationships

2019-04-04 Thread Hugi Thordarson
Hi all, The legacy DB I'm currently working with is designed around compound PKs. Let's take a part of three tables as an example: Company - company_id (pk) Customer - company_id (pk) - customer_id (pk) Invoice - company_id (pk) - document_number (pk) - customer_id * Invoice and Customer are r

Re: Generation of primary keys

2018-10-23 Thread Tony
Or given that the schema you generate depends on the data source your using make the datasource selection the first step. That feels like a more normal path. Tony Giaccone On Oct 23, 2018, at 8:58 AM, Andrus Adamchik wrote: >> I guess we can make "autodetect" a default in that dialog. > > H

Re: Generation of primary keys

2018-10-23 Thread Andrus Adamchik
The problem is that we can't generate that PK SQL that you are seeing in "autodetect" mode. Because it is different from DB to DB. So we either need an explicit DB selection or we need to connect to a real DB to do auto-detect before you see any SQL. A. > On Oct 23, 2018, at 4:51 PM, Tony wro

Re: Generation of primary keys

2018-10-23 Thread Tony
You could put a two choice radio button. Choice one autodetect. Choice two choose adaptor. Default to choice one. Enable drop down when choice two is selected. Tony Giaccone On Oct 23, 2018, at 8:58 AM, Andrus Adamchik wrote: >> I guess we can make "autodetect" a default in that dialog. > >

Re: Generation of primary keys

2018-10-23 Thread Andrus Adamchik
> I guess we can make "autodetect" a default in that dialog. Hmm.. we can't. As this dialog is shown before we even connect to DB. Andrus > On Oct 23, 2018, at 3:45 PM, Andrus Adamchik wrote: > > Yeah, you'd need to select the specific adapter right in the generation > dialog. > > I guess

Re: Generation of primary keys

2018-10-23 Thread Andrus Adamchik
Yeah, you'd need to select the specific adapter right in the generation dialog. I guess we can make "autodetect" a default in that dialog. Andrus > On Oct 23, 2018, at 2:22 PM, Tony Giaccone wrote: > > It might be useful for the Modeler to auto-detect as well because if you do > schema genera

Re: Generation of primary keys

2018-10-23 Thread Tony Giaccone
It might be useful for the Modeler to auto-detect as well because if you do schema generation, you end up with different sql from the modeler than the runtime. We started a dbdeploy process, and the sql generated was captured from the modeler with the JDBC plain adaptor for the auto_pk, but then i

Re: Generation of primary keys

2018-10-22 Thread Andrus Adamchik
If you don't set the adapter, Cayenne will auto-detect the DB type in runtime and install a proper adapter. Modeler doesn't do auto-detection, but the runtime does. In fact I don't remember when was the last time I had to specify an adapter explicitly. Andrus > On Oct 23, 2018, at 12:38 AM, T

Generation of primary keys

2018-10-22 Thread Tony Giaccone
I understand that the kind of PK support that Cayenne uses depends on the adaptor you use. When you use: org.apache.cayenne.dba.postgres.PostgresAdapter you get sequences, not the pk_auto table. I see where you can pick the adaptor as part of a database schema generation. What's less clear to me

Re: DB with totally manually managed primary keys

2016-10-18 Thread Hugi Thordarson
Ah, of course everything works like a charm as soon as I’ve provided the value myself. Thanks Michael! Cheers, - hugi > On 18. okt. 2016, at 15:38, Michael Gentry wrote: > > Hi Hugi, > > Take a look at the model/code under here: > > https://github.com/mrg/cbe/tree/master/InsertingObjects/M

Re: DB with totally manually managed primary keys

2016-10-18 Thread Michael Gentry
Hi Hugi, Take a look at the model/code under here: https://github.com/mrg/cbe/tree/master/InsertingObjects/MeaningfulPK Essentially you map the meaningful key as a Java attribute and set the DB PK generation strategy to "Default" for those tables. As long as you supply the meaningful PKs, Cayen

DB with totally manually managed primary keys

2016-10-18 Thread Hugi Thordarson
Hi all, I’m currently working on a legacy DB where primary key values are both meaningful and completely manually managed in code (no automatic PK generation, sequences or anything, but have to be specified by the programmer). How do I tell Cayenne to not attempt to create PKs? Cheers, - hugi

Re: Fetching a list of objects from a list of primary keys

2016-09-14 Thread John Huss
val5 AND pk2 = val6 On Wed, Sep 14, 2016 at 3:41 PM Oksana Peterburgskaya < oksana.peterburgsk...@amphorainc.com> wrote: > Hello, > I'm currently working on a case related to this post where I try to fetch > a list of objects based on a list of primary keys. The dif

Re: Fetching a list of objects from a list of primary keys

2016-09-14 Thread Oksana Peterburgskaya
Hello, I'm currently working on a case related to this post where I try to fetch a list of objects based on a list of primary keys. The difference for me is that the primary key consists of multiple fields id db. If I try to use ObjectForPK(), it accepts such multi-park PKs. However, if

Re: Fetching a list of objects from a list of primary keys

2016-04-14 Thread Hugi Thordarson
t;> On 14. apr. 2016, at 06:34, Andrus Adamchik wrote: >>> >>> Actually a simple IN qualifier should work. >>> >>> Andrus >>> >>>> On Apr 12, 2016, at 11:38 AM, Hugi Thordarson wrote: >>>> >>>> Hi all. >>

Re: Fetching a list of objects from a list of primary keys

2016-04-14 Thread Andrus Adamchik
gt;> On Apr 12, 2016, at 11:38 AM, Hugi Thordarson wrote: >>> >>> Hi all. >>> I have a list of primary keys [3,4,5,etc…] and I’d like to fetch all the >>> corresponding objects in one go. >>> Do I have to expose the primary key of my entity t

Re: Fetching a list of objects from a list of primary keys

2016-04-14 Thread Hugi Thordarson
ctually a simple IN qualifier should work. > > Andrus > >> On Apr 12, 2016, at 11:38 AM, Hugi Thordarson wrote: >> >> Hi all. >> I have a list of primary keys [3,4,5,etc…] and I’d like to fetch all the >> corresponding objects in one go. >> Do I have t

Re: Fetching a list of objects from a list of primary keys

2016-04-13 Thread Andrus Adamchik
Actually a simple IN qualifier should work. Andrus > On Apr 12, 2016, at 11:38 AM, Hugi Thordarson wrote: > > Hi all. > I have a list of primary keys [3,4,5,etc…] and I’d like to fetch all the > corresponding objects in one go. > Do I have to expose the primary key of my en

Fetching a list of objects from a list of primary keys

2016-04-12 Thread Hugi Thordarson
Hi all. I have a list of primary keys [3,4,5,etc…] and I’d like to fetch all the corresponding objects in one go. Do I have to expose the primary key of my entity to do this or is there some method like Cayenne.objectForPK() that can accept a list of keys and return multiple objects? Cheers

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Mike Kienenberger
eration ("for > performance reasons, Cayenne doesn't ask the DB for a new primary key every > time a record is inserted, but fetches primary keys in batches etc.…”). I’ll > write something up for the documentation and submit it. Shouldn’t > modifications to documentation

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Hugi Thordarson
Well, it could be documented in the article on primary key generation ("for performance reasons, Cayenne doesn't ask the DB for a new primary key every time a record is inserted, but fetches primary keys in batches etc.…”). I’ll write something up for the documentation and submit it.

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Mike Kienenberger
gt;> matches what Cayenne is using, though, otherwise you'll run into issues. >> >> mrg >> >> >> On Tue, Oct 13, 2015 at 5:38 AM, Hugi Thordarson wrote: >> >>> Hi again all! >>> >>> I’m running into a problem where I’m getting dup

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Hugi Thordarson
AM, Hugi Thordarson wrote: > >> Hi again all! >> >> I’m running into a problem where I’m getting duplicate primary keys in >> Postgresql, i.e. records are getting the same primary key (when multiple >> threads are writing to the same table). Any idea how I can prevent thi

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Michael Gentry
ote: > Hi again all! > > I’m running into a problem where I’m getting duplicate primary keys in > Postgresql, i.e. records are getting the same primary key (when multiple > threads are writing to the same table). Any idea how I can prevent this? Do > I have to perform any manual

Duplicate primary keys in Postgresql

2015-10-13 Thread Hugi Thordarson
Hi again all! I’m running into a problem where I’m getting duplicate primary keys in Postgresql, i.e. records are getting the same primary key (when multiple threads are writing to the same table). Any idea how I can prevent this? Do I have to perform any manual synchronization? Cheers

Re: Primary Keys

2012-11-03 Thread Garth Keesler
tedes Maniatis wrote: Indeed, the bottom line is this: Cayenne happily supports meaningful primary keys. Just expose them in the modeler and make sure you have your own key generation process in place. I stand by my statement that meaningful keys are to be avoided whenever possible. If

Re: Primary Keys

2012-11-02 Thread Aristedes Maniatis
Indeed, the bottom line is this: Cayenne happily supports meaningful primary keys. Just expose them in the modeler and make sure you have your own key generation process in place. I stand by my statement that meaningful keys are to be avoided whenever possible. If you don't trust

Re: Primary Keys

2012-11-02 Thread Michael Gentry
aniatis wrote: >> >> On 2/11/12 6:35am, Garth Keesler wrote: >>> >>> Can the PK as specified in the DBEntity be different than the PK actually >>> specified in the schema? I ask because I use DB-generated integer sequences >>> as the primary keys which

Re: Primary Keys

2012-11-02 Thread Garth Keesler
wrote: Can the PK as specified in the DBEntity be different than the PK actually specified in the schema? I ask because I use DB-generated integer sequences as the primary keys which are never used in the software. The software uses an abbreviated form of the vendor name that is forced to be unique wit

Re: Primary Keys

2012-11-01 Thread Aristedes Maniatis
On 2/11/12 6:35am, Garth Keesler wrote: Can the PK as specified in the DBEntity be different than the PK actually specified in the schema? I ask because I use DB-generated integer sequences as the primary keys which are never used in the software. The software uses an abbreviated form of the

Primary Keys

2012-11-01 Thread Garth Keesler
Can the PK as specified in the DBEntity be different than the PK actually specified in the schema? I ask because I use DB-generated integer sequences as the primary keys which are never used in the software. The software uses an abbreviated form of the vendor name that is forced to be unique

Re: Generated primary keys are being truncated

2012-07-20 Thread Andrus Adamchik
tor, I simple changed the code to always return a LONG (all of > our primary keys are NUMERIC and at least 10 digits). > > Joe > > On Jul 20, 2012, at 6:16 AM, Andrus Adamchik wrote: > >>> How do I specify a primary key type to be BIGINT? >> >> >>

Re: Generated primary keys are being truncated

2012-07-20 Thread Joseph Senecal
iding OraclePkGenerator, I simple changed the code to always return a LONG (all of our primary keys are NUMERIC and at least 10 digits). Joe On Jul 20, 2012, at 6:16 AM, Andrus Adamchik wrote: >> How do I specify a primary key type to be BIGINT? > > > This is exactly what you need to

Re: Generated primary keys are being truncated

2012-07-20 Thread Andrus Adamchik
he return value of LongPkRange.getNextPrimaryKey. >>> >>> But the inserts are using PKs like 929781294. 5224748590 - 2^32 = >>> 929781294. Something is stripping off the high order bits of the primary >>> keys. >>> >>> I've checked my

Re: Generated primary keys are being truncated

2012-07-19 Thread Joseph Senecal
M3 in production. We have just discovered that the >> primary keys being generated are being truncated to fit an int. >> >> The sequence returns numbers like 5224748590. I've confirmed this by logging >> the return value of LongPkRange.getNextPrimaryKey. >>

Re: Generated primary keys are being truncated

2012-07-19 Thread Aristedes Maniatis
Look at the columns widths of the AUTO_PK table? Ari On 20/07/12 10:07am, Joseph Senecal wrote: We are using Cayenne 3.1 M3 in production. We have just discovered that the primary keys being generated are being truncated to fit an int. The sequence returns numbers like 5224748590. I&#x

Generated primary keys are being truncated

2012-07-19 Thread Joseph Senecal
We are using Cayenne 3.1 M3 in production. We have just discovered that the primary keys being generated are being truncated to fit an int. The sequence returns numbers like 5224748590. I've confirmed this by logging the return value of LongPkRange.getNextPrimaryKey. But the inserts are

Re: Natural primary keys, Was: Cayenne with JSF 2

2012-04-04 Thread Mike Kienenberger
We're not talking about whether or not a SSN uniquely identifies a person. We are talking about the process for changing up an incorrectly-entered natural primary key, for whatever reason that might be. On Wed, Apr 4, 2012 at 9:36 AM, Durchholz, Joachim wrote: > Seems like everybody is looking a

RE: Natural primary keys, Was: Cayenne with JSF 2

2012-04-04 Thread Durchholz, Joachim
Seems like everybody is looking at the institutions that can't keep their numbers constant. Give it a break. Ordinal numbers of chemical elements cannot change, by definition. I may be too optimistic about ISBNs and EANs. Haven't dealt with them and don't know how reliable their issuers are. I g

Re: Natural primary keys, Was: Cayenne with JSF 2

2012-04-04 Thread Michael Gentry
Maybe your government doesn't goof up social security numbers, but ours does. :-) http://www2.nbc4i.com/news/2010/dec/06/2/study-finds-millions-duplicate-social-security-num-ar-316988/ Also, don't forget that if a social security number (let's assume the government never messes up and assigns th

Natural primary keys, Was: Cayenne with JSF 2

2012-04-04 Thread Aristedes Maniatis
e), the agreement you make with the software is "Give me objects and don't bother me with how they are stored." SQL with a primary key or 12 chimpanzees with punch cards, it doesn't matter. Sure you can open the hood and tinker with the engine. But if you just want to just dr

Re: Using primary keys in expressions

2012-04-03 Thread Andrus Adamchik
Yeah sorry, I replied too soon :) While you can do 'matchAnyExp' with HOLLOW objects without triggering their resolution, getting a handle of a HOLLOW object may require some code. So 'inDbExp' is the solution in this case. Andrus On Apr 3, 2012, at 7:32 PM, Ramiro Aparicio wrote: > As I see

Re: Using primary keys in expressions

2012-04-03 Thread Ramiro Aparicio
As I see it that will indeed use a query per user to create the expression, as every objectForPk will need one query to at least determine if the user exist or not and retrieve the user object, wich is just what I was trying to avoid. El 03/04/2012 18:21, Andrus Adamchik escribió: Actually h

Re: Using primary keys in expressions

2012-04-03 Thread Andrus Adamchik
On Apr 3, 2012, at 6:18 PM, Ramiro Aparicio wrote: > I know I can use objectForPK for every id but that doesn't seem to be too > sensible, so can anyone please point me another way to get the user list in > just 1 query? Ah sorry didn't notice that you already mentioned this solution and didn'

Re: Using primary keys in expressions

2012-04-03 Thread Andrus Adamchik
Actually here is a more terse syntax: User u2 = Cayenne.objectForPk(context, User.class, 2); User u5 = Cayenne.objectForPk(context, User.class, 5); Expression e = ExpressionFactory.matchAnyExp(u2, u5); On Apr 3, 2012, at 7:19 PM, Andrus Adamchik wrote: > Don't forget that Cayenne analog of mat

Re: Using primary keys in expressions

2012-04-03 Thread Andrus Adamchik
Don't forget that Cayenne analog of matching against a PK in DB is matching against the Object itself! User u2 = Cayenne.objectForPk(context, User.class, 2); User u5 = Cayenne.objectForPk(context, User.class, 5); Expression e2 = ExpressionFactory.matchExp(u2); Expression e5 = ExpressionFactory.m

Re: Using primary keys in expressions

2012-04-03 Thread Ramiro Aparicio
Hi Michael, Thank you for the reply, the source is external, a request made to the server to modify several fields of those users, probably your solution to put the field back in the entity is the cleaner but I found that using ExpressionFactory.inDbExp just does the trick. Anyway I will try

Re: Using primary keys in expressions

2012-04-03 Thread Michael Gentry
Hi Ramiro, By default, Cayenne does not map PKs into Java objects because they are considered database artifacts. What is the source of your idUser values (the 2,5)? If external to your application, you can always manually add idUser back into your ObjEntity in Cayenne Modeler. If the source is

Using primary keys in expressions

2012-04-03 Thread Ramiro Aparicio
I am trying to do what I thought it should be an easy query SELECT * FROM Users WHERE idUser IN (2,5) The problem is that it seems that the primary key of tables is somewhat of a special column that is not allowed to be used in expressions as I get Can't resolve path component: [User.idUser].

Re: Modeling MySQL views and primary keys

2012-02-04 Thread Andrus Adamchik
AFAIK there's no way to tell the Modeler to ignore certain manual model tweaks when creating migrations. Things like that are the reason why I am using manual SQL-based migrations to evolve my schema. Andrus On Feb 4, 2012, at 3:11 AM, Tad wrote: > We've got an existing MySQL 5.x database tha

Modeling MySQL views and primary keys

2012-02-03 Thread Tad
We've got an existing MySQL 5.x database that contains a single view. This view includes the primary key column of its source table in its results. When modeling this view with a db-entity (through re-engineering, migration, and manual creation) the modeler tells us that the entity lacks a primary

cayenne 3.0.1 reverse engineering on IBM iseries db2 tables, not identifying primary keys

2011-02-21 Thread Joseph P. Berglund
Cayenne Users, I am evaluating whether I can use Cayenne 3.0.1 for my company, we use an IBM iSeries DB2 (as opposed to DB2 universal database). The cayenne modeller reverse engineering tool correctly identifies the schemas, attributes, and their types but fails to identify the primary keys

Re: Primary Keys Issue

2010-06-02 Thread Sopot Çela
Thank you very much Andrus for your quick and accurate response. - Original Message From: Andrus Adamchik To: user@cayenne.apache.org Sent: Wed, June 2, 2010 3:31:17 PM Subject: Re: Primary Keys Issue Hi there, You will need to check "Meaningful PK" check box when doi

Re: Primary Keys Issue

2010-06-02 Thread Andrus Adamchik
Hi there, You will need to check "Meaningful PK" check box when doing reverse- engineering. Andrus On Jun 2, 2010, at 9:23 AM, Sopot Çela wrote: Hello all, I have an issue. I have CayenneModeller import a database structure from a MySQL database. When I generate the classes I want that *

Primary Keys Issue

2010-06-02 Thread Sopot Çela
Hello all, I have an issue. I have CayenneModeller import a database structure from a MySQL database. When I generate the classes I want that *all* the classes have also the primary key field. Surely I can do it manually for every table, that is, add an attribute and relate it to the primary ke

Re: Primary Key Access and Exposed Primary Keys

2010-05-04 Thread Andrew Lindesay
Hello Marcin; Thanks for that -- your telling me it works on "default" as exposed attributes was useful. I have the issue resolved now. What had happened is that I had over-riden the Cayenne validation and was validating for object-exposed PK's which triggered the not-NULL check before they w

Re: Primary Key Access and Exposed Primary Keys

2010-05-03 Thread Marcin Skladaniec
through the OID's faulting them. The problem is that by exposing the "ID_PROPERTY", Cayenne (as with EOF) appears to stop automatically creating primary keys from sequences. My question is; * is there a means by which I can allow Cayenne to continue to allocate primary keys despit

Primary Key Access and Exposed Primary Keys

2010-05-03 Thread Andrew Lindesay
ERTY+" > ?1"; From this I can make OID's and then allow a batch process to work through the OID's faulting them. The problem is that by exposing the "ID_PROPERTY", Cayenne (as with EOF) appears to stop automatically creating primary keys from sequences. My q

Re: Retrieving Records for a range of primary keys

2009-12-17 Thread Hans Pikkemaat
p() is for you to go. See http://cayenne.apache.org/doc/path-expressions.html 2009/12/17 Hans Pikkemaat Hi, Some paginated mechanisms are based on a persistence layer to be able to retrieve records for a range of primary keys. I know it is possible to insert the primary key field in th

Re: Retrieving Records for a range of primary keys

2009-12-17 Thread Andrey Razumovsky
>>> >>> tx >>> >>> Hans >>> >>> >>> Andrey Razumovsky wrote: >>> >>> >>> >>>> If you're using SelectQuery, Expression.inDbExp() is for you to go. See >>>> http://cayenne.apache.org/doc/p

Re: Retrieving Records for a range of primary keys

2009-12-17 Thread Hans Pikkemaat
ons.html 2009/12/17 Hans Pikkemaat Hi, Some paginated mechanisms are based on a persistence layer to be able to retrieve records for a range of primary keys. I know it is possible to insert the primary key field in the definition but then I'm also required to populate it when

Re: Retrieving Records for a range of primary keys

2009-12-17 Thread Andrey Razumovsky
9/12/17 Hans Pikkemaat >> >> >> >>> Hi, >>> >>> Some paginated mechanisms are based on a persistence layer to be able to >>> retrieve records for a range of primary keys. >>> >>> I know it is possible to insert the primary

Re: Retrieving Records for a range of primary keys

2009-12-17 Thread Hans Pikkemaat
to go. See http://cayenne.apache.org/doc/path-expressions.html 2009/12/17 Hans Pikkemaat Hi, Some paginated mechanisms are based on a persistence layer to be able to retrieve records for a range of primary keys. I know it is possible to insert the primary key field in the definition but then I'm also req

Re: Retrieving Records for a range of primary keys

2009-12-17 Thread Andrey Razumovsky
If you're using SelectQuery, Expression.inDbExp() is for you to go. See http://cayenne.apache.org/doc/path-expressions.html 2009/12/17 Hans Pikkemaat > Hi, > > Some paginated mechanisms are based on a persistence layer to be able to > retrieve records for a range of primary ke

Retrieving Records for a range of primary keys

2009-12-17 Thread Hans Pikkemaat
Hi, Some paginated mechanisms are based on a persistence layer to be able to retrieve records for a range of primary keys. I know it is possible to insert the primary key field in the definition but then I'm also required to populate it when I create a record. I'm using a sequence

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-03 Thread Kevin Menard
talking about are surrogate primary keys. > > http://en.wikipedia.org/wiki/Surrogate_key > > Which is generally accepted as a best practice (well mostly, depending on > the DBA). > > regards Malcolm Edgar > > On Tue, Feb 3, 2009 at 1:48 AM, Matt Kerr wrote: > >

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-02 Thread Malcolm Edgar
I think what we are talking about are surrogate primary keys. http://en.wikipedia.org/wiki/Surrogate_key Which is generally accepted as a best practice (well mostly, depending on the DBA). regards Malcolm Edgar On Tue, Feb 3, 2009 at 1:48 AM, Matt Kerr wrote: > > Do poeple agree w/ m

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Nikos Paraschou
; > > Cheers, > > > Pierre > > > > > > Cordialement, > > > Pierre Lavignotte > > > Ingénieur Conception & Développement > > > http://pierre.lavignotte.googlepages.com > > > > > > > > > On Mon, Feb 2, 2009 at 12:35 PM, Νίκος Πα

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-02 Thread Matt Kerr
> Do poeple agree w/ me here? yes. On Mon, Feb 2, 2009 at 9:15 AM, Eric Lazarus wrote: > I can't let this point(er) go buy: JUST SAY NO TO MEANINGFUL POINTERS! > > There are BIG problems with having meaningful primary keys in general in > terms of keeping your program gro

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-02 Thread John Armstrong
09 at 3:15 PM, Eric Lazarus > wrote: > > > I can't let this point(er) go buy: JUST SAY NO TO MEANINGFUL POINTERS! > > > > There are BIG problems with having meaningful primary keys in general in > > terms of keeping your program growing and useful long term. When

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Alessio Giovanni Baroni
But to have the full control on handling the primary keys, I always set the strategy option, else the keys are handled by cayenne. 2009/2/2 Pierre Lavignotte > I don't think his question is about sequence usage but about selecting rows > with specific PK values... > > Cordi

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-02 Thread Pierre Lavignotte
POINTERS! > > There are BIG problems with having meaningful primary keys in general in > terms of keeping your program growing and useful long term. When you can > avoid it, avoid it... and when YOU are designing the underlying database > from scratch, I think you can almost alwa

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-02 Thread Andrus Adamchik
Eric Lazarus wrote: I can't let this point(er) go buy: JUST SAY NO TO MEANINGFUL POINTERS! There are BIG problems with having meaningful primary keys in general in terms of keeping your program growing and useful long term. When you can avoid it, avoid it... and when YOU are designing the

Re: How to create Meaningful Primary Keys? JUST SAY NO TO MEANINGFUL POINTERS!

2009-02-02 Thread Eric Lazarus
I can't let this point(er) go buy: JUST SAY NO TO MEANINGFUL POINTERS!   There are BIG problems with having meaningful primary keys in general in terms of keeping your program growing and useful long term. When you can avoid it, avoid it... and when YOU are designing the underlying dat

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Andrus Adamchik
te Ingénieur Conception & Développement http://pierre.lavignotte.googlepages.com On Mon, Feb 2, 2009 at 12:35 PM, Νίκος Παράσχου wrote: Hello, It is the first time I am using cayenne and I have some questions regarding the primary keys. What I want to do is select some rows of a table whe

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Pierre Lavignotte
l your tables, then maybe you need to generate > them. > > > But if you only need to use them for a couple tables then you should > look > > at > > > DataObjectUtils class. > > > > > > > > > Cheers, > > > Pierre > > > > > > Cordia

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Alessio Giovanni Baroni
; > > > Cordialement, > > Pierre Lavignotte > > Ingénieur Conception & Développement > > http://pierre.lavignotte.googlepages.com > > > > > > On Mon, Feb 2, 2009 at 12:35 PM, Νίκος Παράσχου > wrote: > > > > > Hello, > > > &g

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Pierre Lavignotte
Pierre > > > > Cordialement, > > Pierre Lavignotte > > Ingénieur Conception & Développement > > http://pierre.lavignotte.googlepages.com > > > > > > On Mon, Feb 2, 2009 at 12:35 PM, Νίκος Παράσχου > wrote: > > > > > Hello, >

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Νίκος Παράσχου
, 2009 at 12:35 PM, Νίκος Παράσχου wrote: > > > Hello, > > > > It is the first time I am using cayenne and I have some questions > > regarding the primary keys. > > > > What I want to do is select some rows of a table where the PK has a > > specific va

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Alessio Giovanni Baroni
cting the field PK also. Alessio. 2009/2/2 Νίκος Παράσχου > Hello, > > It is the first time I am using cayenne and I have some questions > regarding the primary keys. > > What I want to do is select some rows of a table where the PK has a > specific value. The problem is I can

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Pierre Lavignotte
http://pierre.lavignotte.googlepages.com On Mon, Feb 2, 2009 at 12:35 PM, Νίκος Παράσχου wrote: > Hello, > > It is the first time I am using cayenne and I have some questions > regarding the primary keys. > > What I want to do is select some rows of a table where the PK has a > specific valu

How to create Meaningful Primary Keys?

2009-02-02 Thread Νίκος Παράσχου
Hello, It is the first time I am using cayenne and I have some questions regarding the primary keys. What I want to do is select some rows of a table where the PK has a specific value. The problem is I can't access the PK. I can specify qualifiers only with the non-PK columns. The PKs I am

Re: Mapping primary keys getter methods

2009-01-23 Thread Andrus Adamchik
issue is that he has meaningful primary keys, and he wants to have primary key accessors with meaningful names. Ie, for an Account table, he might want to have "getAccountNumber()" or for a User table, he might want to have "getUserName()" (assuming these are the primary key fi

  1   2   >