dev@glassfish.java.net

Re: Default Table name for Table Generator

From: Markus KARG <markus.karg_at_gmx.net>
Date: Mon, 18 Jun 2007 21:22:11 +0200

Gordon Yorke schrieb:
> Hello Markus,
> The default generator name is : 'SEQ_GEN_TABLE', which has a default table name of 'SEQUENCE'.
>
Maybe there still is a misunderstanding. I have created the table
SEQUENCE with the needed columns. I have added a key "foo" with a value
of 1000. When I use (generator="foo") then all works well. Now I want to
remove (generator="foo") from my Java code, and rename the key in the
database to match the default. What default name must I set? I tried
changing "foo" into "SEQ_TABLE_NAME" but TopLink says it doesn't find
the row in the DB. As soon as I change back to "foo" and redeploy again,
it works again.

So what is the default key name to use? And why is there no description
about that on the web? ;-(

Thanks a lot
Markus
> --Gordon
>
> -----Original Message-----
> From: Markus KARG [mailto:markus.karg_at_gmx.net]
> Sent: Monday, June 18, 2007 2:38 PM
> To: dev_at_glassfish.dev.java.net
> Subject: Re: Default Table name for Table Generator
>
>
> Gordon Yorke schrieb:
>
>> The default table name is SEQUENCE and this table will be shared by all entities that do not have a generator defined.
>> --Gordon
>>
>>
> Sorry I did not ask precisely enough. I have set up the SEQUENCE table
> already -- otherwise (strategy=TABLE,generator="foo") wouldn't work,
> obviously. What I wanted to ask was not the default table name, but the
> default GENERATOR name. So if I do not specify generator="foo", what is
> the default generator's name?
>
> Thanks
> Markus
>
>> -----Original Message-----
>> From: Markus KARG [mailto:markus.karg_at_gmx.net]
>> Sent: Sunday, June 17, 2007 2:54 AM
>> To: dev_at_glassfish.dev.java.net
>> Subject: Default Table name for Table Generator
>>
>>
>> When I specify @GeneratedValue(strategy=TABLE,generator="foo") then GF
>> is using the table "foo" for generating IDs.
>> If I just specify @GeneratedValue(strategy=TABLE), what is the default
>> table name that GF with actually use at runtime?
>> As a "simple user" I expected that GF uses the name of the entity bean
>> class (that one annotated with @Entity) but it seems that is not working.
>>
>> Thanks
>> Markus
>>
>>
>
>
>


-- 
http://www.xing.com/go/invita/58469