Repository navigation
Alternative solution to #1193 #1199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gavinking
wants to merge
18
commits into
jakartaee:main
Choose a base branch
from
gavinking:tuplestuff
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e5aac1f
add Parameter.of() and Tuple.of()
gavinking 8457833
add binding from Parameter -> Tuple.Entry
gavinking f647aee
optimize Tuple/TupleRecord
gavinking bd6ca37
add Reference.getArgumentTuple
gavinking c40543a
add Reference.getParameters
gavinking 1ed5c0c
Add (c) headers
gavinking 0ff822a
Fixes from Nathan
gavinking b9d926d
fix equals/hashCode/toString for TupleRecord
gavinking a305a54
don't return immutable collections
gavinking c0b28f5
javadoc fix from Nathan
gavinking c81c1ae
add TupleElement.of()
gavinking cddcff4
fix indices of Parameters (they are 1-based)
gavinking a916ea3
fix type safety of tuple entries
gavinking 3a905d5
add Tuple.Entry.of()
gavinking 2020747
Javadoc fixes from Nathan
gavinking 32fc45f
introduce Parameter.Argument
gavinking 14b298b
remove Tuple.Entry stuff and break link from Arguments to Tuple
gavinking a5f3a6e
fix setArguments()
gavinking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Eclipse Public License v. 2.0 which is available at | ||
| * http://www.eclipse.org/legal/epl-2.0, | ||
| * or the Eclipse Distribution License v. 1.0 which is available at | ||
| * http://www.eclipse.org/org/documents/edl-v10.php. | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
| */ | ||
| package jakarta.persistence; | ||
|
|
||
| import jakarta.annotation.Nonnull; | ||
|
|
||
| import static java.util.Objects.requireNonNull; | ||
|
|
||
| /** | ||
| * Internal implementation of {@link Parameter.Argument}. | ||
| * @param <T> the type of the parameter | ||
| * @param parameter the parameter | ||
| * @param value the argument bound to the parameter | ||
| * @since 4.0 | ||
| */ | ||
| record ArgumentRecord<T>(@Nonnull Parameter<T> parameter, T value) | ||
| implements Parameter.Argument<T> { | ||
|
|
||
| ArgumentRecord { | ||
| requireNonNull(parameter, "parameter must not be null"); | ||
| } | ||
|
|
||
| @Nonnull | ||
| @Override | ||
| public Parameter<T> getParameter() { | ||
| return parameter; | ||
| } | ||
|
|
||
| @Override | ||
| public T getValue() { | ||
| return value; | ||
| } | ||
| } |
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
48 changes: 48 additions & 0 deletions
48
api/src/main/java/jakarta/persistence/ParameterRecord.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Eclipse Public License v. 2.0 which is available at | ||
| * http://www.eclipse.org/legal/epl-2.0, | ||
| * or the Eclipse Distribution License v. 1.0 which is available at | ||
| * http://www.eclipse.org/org/documents/edl-v10.php. | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
| */ | ||
| package jakarta.persistence; | ||
|
|
||
| import jakarta.annotation.Nonnull; | ||
| import jakarta.annotation.Nullable; | ||
|
|
||
| /** | ||
| * Internal implementation of {@link Parameter}. | ||
| * @param type the Java type of the parameter | ||
| * @param position the position of the parameter, or null if the | ||
| * parameter is not a positional parameter | ||
| * @param name the name of the parameter, or null if the parameter | ||
| * is not a named parameter | ||
| * @param <T> the type of the parameter | ||
| * @see Parameter#of(Class, Integer, String) | ||
| * @since 4.0 | ||
| */ | ||
| record ParameterRecord<T> | ||
| (@Nonnull Class<T> type, @Nullable Integer position, @Nullable String name) | ||
| implements Parameter<T> { | ||
| @Nullable | ||
| @Override | ||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| @Nullable | ||
| @Override | ||
| public Integer getPosition() { | ||
| return position; | ||
| } | ||
|
|
||
| @Nonnull | ||
| @Override | ||
| public Class<T> getParameterType() { | ||
| return type; | ||
| } | ||
| } | ||
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.