users@glassfish.java.net

Re: Entity auto generated id

From: Kenneth Clark <kenneth_at_rabiddog.co.za>
Date: Wed, 24 Jan 2007 18:09:26 +0200

I thought it would be under glassfish because of the @SequenceGenerator,
@TableGenerator etc

I wanted to know if there is anyway I can use one of these to stipulate
a custom class to use for ID generation.

I know that MS SQL does that, but I need it DB independent hence the
reason I suggest implementing it in the Persistence mechanisms

Kenneth Clark
Developer / Analyst

Rabid Dog Laboratories ^(TM)
Putting the art back into development

*tel:* +27 11 475 7409
*mobile:* +27 82 500 5090
*e-mail:* kenneth_at_rabiddog.co.za
*website:* http://www.rabiddog.co.za/


Baker, Brad (Contr) wrote:
>
> This seems like a Data Base question. Not a glassfish dev question.
>
>
>
> MS SQL will do auto gen GUIDs as PKs.
>
>
>
> -Brad
>
>
>
> ------------------------------------------------------------------------
>
> *From:* Kenneth Clark [mailto:kenneth_at_rabiddog.co.za]
> *Sent:* Wednesday, January 24, 2007 8:43 AM
> *To:* users_at_glassfish.dev.java.net
> *Subject:* Re: Entity auto generated id
>
>
>
> Is this even possible? Please help here. Been sitting on this the
> whole day and I just can't find docs on it. Should I rather post this
> in the forum?
>
> Thanks
>
> *Kenneth Clark*
> Developer / Analyst
>
> *Rabid Dog Laboratories ^(TM)*
> Putting the art back into development
>
> *tel:* +27 11 475 7409
> *mobile:* +27 82 500 5090
> *e-mail:* kenneth_at_rabiddog.co.za <mailto:kenneth_at_rabiddog.co.za>
> *website:* http://www.rabiddog.co.za/
>
>
>
> Kenneth Clark wrote:
>
> This might be a really weird question so please forgive me
>
> Is there anyway to auto generate a unique ID using a custom routine
> for the record?
>
> i.e.: I would like to use a GUID as the PK value for an entity. Is
> this possible?
>
> Thanks
>
> --
> *Kenneth Clark*
> Developer / Analyst
>
> *Rabid Dog Laboratories ^(TM)*
> Putting the art back into development
>
> *tel:* +27 11 475 7409
> *mobile:* +27 82 500 5090
> *e-mail:* kenneth_at_rabiddog.co.za <mailto:kenneth_at_rabiddog.co.za>
> *website:* http://www.rabiddog.co.za/
>
>
>
>
> ------------------------------------------------------------------------
>
>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.17.8/649 - Release Date: 23/01/2007 20:40
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.17.8/649 - Release Date: 23/01/2007 20:40
>