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 your database

Re: Primary Keys

2012-11-02 Thread Michael Gentry
Hi Garth, If you have a legacy schema with meaningful PKs, it is fine to map them. In general, especially when creating a new schema, meaningful PKs are to be discouraged, but sometimes you don't have a choice. mrg On Fri, Nov 2, 2012 at 3:51 PM, Garth Keesler wrote: > This issue remains a ho

Re: Primary Keys

2012-11-02 Thread Garth Keesler
This issue remains a hot-button topic out there so here's my situation: I have a list of abbreviated Vendor Names that haven't changed in ten years altho it has been added to. That name is meaningful and is used in a variety of places as a foreign key. It would also make a very nice PK since it

Re: PG CITEXT Data Type

2012-11-02 Thread Garth Keesler
I did the same test and it worked for me as well. Thanx Much, Garth On 11/02/2012 02:06 PM, Andrus Adamchik wrote: I just did a quick test on Cayenne 3.1 and PG 9.1. And all I had to do is to map the DbAttribute type as OTHER instead of VARCHAR and map ObjAttribute as java.lang.String. This d

Re: PG CITEXT Data Type

2012-11-02 Thread Andrus Adamchik
I just did a quick test on Cayenne 3.1 and PG 9.1. And all I had to do is to map the DbAttribute type as OTHER instead of VARCHAR and map ObjAttribute as java.lang.String. This did it. So after all PG's turned out to be one of the few drivers that actually handles type "OTHER" correctly, and th

Re: DataObjectUtils.objectForPK

2012-11-02 Thread Andrus Adamchik
Correct. On Nov 2, 2012, at 5:23 PM, gar...@hiwaay.net wrote: > Sorry, I found later in the docs that the Cayenne class has replaced this. > Question is the same, however. Should I use the Cayenne class to return > single instances if I know the PK? > > Thanx, > Garth > > - Forwarded mess

DataObjectUtils.objectForPK

2012-11-02 Thread garthk
Sorry, I found later in the docs that the Cayenne class has replaced this. Question is the same, however. Should I use the Cayenne class to return single instances if I know the PK? Thanx, Garth - Forwarded message from gar...@hiwaay.net - Date: Fri, 02 Nov 2012 08:13:03 -0500

DataObjectUtils.objectForPK

2012-11-02 Thread garthk
Is this the preferred method for returning a single, specific object instance from the database? Thanx, Garth