You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Adrian Wiesmann <aw...@somap.org> on 2008/05/20 21:51:14 UTC

Anybody using UUIDs with Cayenne?

Hello all

Let's have another question. :)

Has anybody used UUIDs with Cayenne? I am interested in two use cases:

- Configuring Cayenne so that UUIDs can be used in DataObjects without the
need for casts. I tried this some while ago, but Cayenne did not like this
when reading data from the database.

- Storing UUIDs in a database when the database does not support UUIDs
natively. Using varchar(36) seems obvious, but are there any other
concepts?

I am interested in any thoughts, input, comments.

Cheers,
Adrian

Re: Anybody using UUIDs with Cayenne?

Posted by Michael Gentry <bl...@gmail.com>.
Hi Adrian, are you asking if there is an existing UUID primary key
generator for Cayenne?

If you have your own generator, you can set the PKs yourself (or make
your own PK generator) and it should work fine stored as a varchar,
unless I'm overlooking something obvious.

/dev/mrg

On Tue, May 20, 2008 at 3:51 PM, Adrian Wiesmann <aw...@somap.org> wrote:
> Hello all
>
> Let's have another question. :)
>
> Has anybody used UUIDs with Cayenne? I am interested in two use cases:
>
> - Configuring Cayenne so that UUIDs can be used in DataObjects without the
> need for casts. I tried this some while ago, but Cayenne did not like this
> when reading data from the database.
>
> - Storing UUIDs in a database when the database does not support UUIDs
> natively. Using varchar(36) seems obvious, but are there any other
> concepts?
>
> I am interested in any thoughts, input, comments.
>
> Cheers,
> Adrian
>