Teach the SQL generator to declare PostgreSQL casts#321
Merged
jcflack merged 9 commits intoREL1_6_STABLEfrom Oct 25, 2020
Merged
Teach the SQL generator to declare PostgreSQL casts#321jcflack merged 9 commits intoREL1_6_STABLEfrom
jcflack merged 9 commits intoREL1_6_STABLEfrom
Conversation
Now that there will be more than one repeatable annotation type, and there isn't really anything else about the containing annotation that matters. In passing, squelch a deprecation warning in LexicalsTest (a junit method was deprecated, in favor of one from hamcrest).
Introduce a Repeatable subclass of AbstractAnnotationImpl that will carry references to its source Element and AnnotationMirror so they are available a subclass's characterize method, if any.
In passing, give FunctionImpl's appendNameAndParams an extra boolean parameter to suppress parameter names, so it can be used generating CREATE CAST, where function parameter names aren't wanted.
In passing, remove its postgresql_ge_80300 conditionals. The exact oldest PostgreSQL version supportable by PL/Java 1.6 might still be slightly negotiable, but definitely won't be that far back.
Routine tests should include sqlj.remove_jar with undeploy=true, as those actions also come from the SQL generator.
The SQLAction annotation itself can now simply be repeated.
Drop the extra indentation left behind now that @SQLAction needn't be nested in @SQLActions.
Should have been removed in a0efb99.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent work on the SQL generator added enough implicit-dependency-tracking infrastructure that it is now fairly straightforward to implement a
@Castannotation (and possibly others in the future, such as for aggregates and operators).Effect of this patch can be seen in further simplification of Bear Giles's UDT example in jcflack/pljava-udt-type-extension@7987f29.
Until now, the only (ersatz) "repeatable" annotation was
@SQLAction, which appeared in PL/Java 1.5 supporting Java earlier than 8, so in order to 'repeat' it, it had to be wrapped inside@SQLActions.As PL/Java 1.6 supports only Java versions with real repeatable annotations, also declare
SQLActionto be officially repeatable. That allows it to be used without wrapping in@SQLActions(though old code that does wrap it will also still compile and work). Update the examples to leave out the no-longer-needed wrapping.Generalize the repeated-annotation processing logic in
DDRProcessorso now@Cast, and other future repeatable annotations, can share it.