|
|
|
Re: SequenceGenerator and schema [message #517536 is a reply to message #516501] |
Mon, 01 March 2010 08:48 |
Enrico Messages: 82 Registered: July 2009 |
Member |
|
|
Hi,
any help about my issue?
Simple I would like to get the schema name for Sequence from orm.xml!
Is it possible?
Otherwise, I think the best solution is to convert my SequenceGenerator
into TableGenerator, in order to have the table in the Schema name
specified on the orm.xml file!
BR,
Enrico
So, for example:
Enrico ha scritto:
> HI Doug,
>
> thank you for your reply.
> I tried but a compile error occuour:
>
> "The attribute schema is undefined for the annotation type
> SequenceGenerator"
>
> I am using Java Persistence 1.0.
>
> Anyway, I would like also to know if it is possible to set the schema
> name only in one point and not on all entity class. In particular I
> would like to get the schema name always from the orm.xml file.
>
> Because if I set the schema name in the entity class I need every time
> to recompile the class if I need to use the same class for another
> project (e.g. two context that use same classes and same DB but on
> different schema names). I now I can configure any entity on xml file
> but I would like to now if I can get the shema names also for sequences
> from the orm.xml file.
>
> BR,
> Enrico
>
>
>
>
> Doug Clarke ha scritto:
>> Enrico,
>>
>> Have you set the schema attribute in the @SequenceGenerator?
>>
>> @SequenceGenerator(name="ADDRESS_SEQ", schema="SCHEMA1",
>> allocationSize=25)
>>
>>
>> Doug
|
|
|
Re: SequenceGenerator and schema [message #518037 is a reply to message #516239] |
Tue, 02 March 2010 20:20 |
|
There is a tableQualifier on the EclipseLink DatabaseLogin (from Session), you can set this using a SessionCustomizer and it will be set on every table and sequence that has not defined its own qualifier. You can also get each NativeSequence object from the Session's DatabaseLogin and set its qualifier.
We don't currently seem to have a persistence unit property for the tableQualifier (default schema) we should, please log a bug for this.
James : Wiki : Book : Blog : Twitter
|
|
|
Powered by
FUDForum. Page generated in 0.03217 seconds