Skip to content
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

add two metamodel getters to AttributeNode and Graph #692

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/src/main/java/jakarta/persistence/AttributeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
*/

// Contributors:
// Gavin King - 4.0
// Linda DeMichiel - 2.1

package jakarta.persistence;

import jakarta.persistence.metamodel.Attribute;

import java.util.Map;

/**
Expand All @@ -37,6 +40,15 @@ public interface AttributeNode<T> {
*/
String getAttributeName();

/**
* The attribute from which this branch of the graph or subgraph is forked.
*
* @return The metamodel object representing the graphed attribute
*
* @since 4.0
*/
Attribute<?,T> getAttribute();

/**
* Return a map of subgraphs associated with this attribute
* node.
Expand Down
11 changes: 11 additions & 0 deletions api/src/main/java/jakarta/persistence/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
*/

// Contributors:
// Gavin King - 4.0
// Gavin King - 3.2

package jakarta.persistence;

import jakarta.persistence.metamodel.Attribute;
import jakarta.persistence.metamodel.ManagedType;
import jakarta.persistence.metamodel.MapAttribute;
import jakarta.persistence.metamodel.PluralAttribute;

Expand All @@ -31,6 +33,15 @@
*/
public interface Graph<T> {

/**
* The managed type at which this graph or subgraph is rooted.
*
* @return The metamodel object representing the graphed type
*
* @since 4.0
*/
ManagedType<T> getGraphedType();

/**
* Get an existing attribute node for the attribute with the given
* name, or add a new attribute node if there is no existing node.
Expand Down
Loading