| Summary: | JPA 2.0 Schema/Catalog on SequenceGenerator | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Andrei Ilitchev <andrei.ilitchev> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P2 | CC: | karenfbutzke | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Andrei Ilitchev
Created attachment 141821 [details]
Proposed patch
The patch refactors Sequence heirarchy moving attribute qualifier from TableSequence and UnaryTableSequence up to Sequence class.
Before qualifier was copied from platform.tableQualifier.
Now that happens only if qualifier hasn't been explicitly assigned.
SequenceGeneratorMetadata assignes qualifier (catalog.schema) to corresponding NativeSequence object.
NativeSequence passes qualified name to the platforms, platforms no longer qualify the name.
DDL generating SequenceObjectDefinition class uses NativeSequence's qualifier, too.
Created attachment 141927 [details]
Slightly updated patch
The patch was corrected following Guy's suggestions:
Looks fine, the only thing being the context. You re-used the existing table context which is used with @Table defaulting, meaning your log messages when defaulting any sequence generator will use these log string
"The table schema for entity [{0}] is being defaulted to: {1}."
"The table catalog for entity [{0}] is being defaulted to: {1}."
I'd create new contexts, it's very simple (3 steps)
1 - Create new statics in MetadataLogger
public static final String SEQUENCE_GENERATOR_SCHEMA = "metadata_default_sequence_generator_schema";
public static final String SEQUENCE_GENERATOR_CATALOG = "metadata_default_sequence_generator_catalog";
2 - add those context strings in the contructor for MetadataLogger
addContextString(SEQUENCE_GENERATOR_SCHEMA);
addContextString(SEQUENCE_GENERATOR_CATALOG);
3 - add the logging strings to org.eclipse.persistence.internal.localization.i18n.LoggingLocalizationResource
{ "metadata_default_sequence_generator_schema", "The sequence generator schema defined within [{0}] is being defaulted to: {1}." },
{ "metadata_default_sequence_generator_catalog", "The sequence generator catalog defined within [{0}] is being defaulted to: {1}." },
Then have SequenceGeneratorMetadata return those context strings instead and that will do it.
Cheers,
Guy
Checked into trunk. Mass update to change fixed in target. Mass update to change fixed in target. Mass update to change fixed in target. Mass update to change fixed in target. *** Bug 259162 has been marked as a duplicate of this bug. *** The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |