8
8
import org .hibernate .grammars .graph .GraphLanguageLexer ;
9
9
import org .hibernate .grammars .graph .GraphLanguageParser ;
10
10
import org .hibernate .grammars .graph .GraphLanguageParserBaseVisitor ;
11
+ import org .hibernate .graph .GraphNode ;
11
12
import org .hibernate .graph .InvalidGraphException ;
12
13
import org .hibernate .graph .spi .AttributeNodeImplementor ;
13
14
import org .hibernate .graph .spi .GraphImplementor ;
24
25
/**
25
26
* @author Steve Ebersole
26
27
*/
27
- public class GraphParser extends GraphLanguageParserBaseVisitor {
28
+ public class GraphParser extends GraphLanguageParserBaseVisitor < GraphNode <?>> {
28
29
29
30
/**
30
31
* Parse the passed graph textual representation into the passed Graph.
@@ -64,16 +65,16 @@ public static void parseInto(
64
65
65
66
private final SessionFactoryImplementor sessionFactory ;
66
67
67
- private final Stack <GraphImplementor > graphStack = new StandardStack <>();
68
- private final Stack <AttributeNodeImplementor > attributeNodeStack = new StandardStack <>();
68
+ private final Stack <GraphImplementor <?> > graphStack = new StandardStack <>();
69
+ private final Stack <AttributeNodeImplementor <?,?,?> > attributeNodeStack = new StandardStack <>();
69
70
private final Stack <SubGraphGenerator > graphSourceStack = new StandardStack <>();
70
71
71
72
public GraphParser (SessionFactoryImplementor sessionFactory ) {
72
73
this .sessionFactory = sessionFactory ;
73
74
}
74
75
75
76
@ Override
76
- public AttributeNodeImplementor visitAttributeNode (GraphLanguageParser .AttributeNodeContext ctx ) {
77
+ public AttributeNodeImplementor <?,?,?> visitAttributeNode (GraphLanguageParser .AttributeNodeContext ctx ) {
77
78
final String attributeName = ctx .attributePath ().ATTR_NAME ().getText ();
78
79
79
80
final SubGraphGenerator subGraphCreator ;
@@ -105,7 +106,7 @@ public AttributeNodeImplementor visitAttributeNode(GraphLanguageParser.Attribute
105
106
subGraphCreator = pathQualifierType .getSubGraphCreator ();
106
107
}
107
108
108
- final AttributeNodeImplementor attributeNode = resolveAttributeNode ( attributeName );
109
+ final AttributeNodeImplementor <?,?,?> attributeNode = resolveAttributeNode ( attributeName );
109
110
110
111
if ( ctx .subGraph () != null ) {
111
112
attributeNodeStack .push ( attributeNode );
@@ -132,12 +133,11 @@ public AttributeNodeImplementor visitAttributeNode(GraphLanguageParser.Attribute
132
133
return attributeNode ;
133
134
}
134
135
135
-
136
- private AttributeNodeImplementor resolveAttributeNode (String attributeName ) {
136
+ private AttributeNodeImplementor <?,?,?> resolveAttributeNode (String attributeName ) {
137
137
final GraphImplementor <?> currentGraph = graphStack .getCurrent ();
138
138
assert currentGraph != null ;
139
139
140
- final AttributeNodeImplementor attributeNode = currentGraph .findOrCreateAttributeNode ( attributeName );
140
+ final AttributeNodeImplementor <?,?,?> attributeNode = currentGraph .findOrCreateAttributeNode ( attributeName );
141
141
assert attributeNode != null ;
142
142
143
143
return attributeNode ;
@@ -156,7 +156,7 @@ private PathQualifierType resolvePathQualifier(String qualifier) {
156
156
}
157
157
158
158
@ Override
159
- public SubGraphImplementor visitSubGraph (GraphLanguageParser .SubGraphContext ctx ) {
159
+ public SubGraphImplementor <?> visitSubGraph (GraphLanguageParser .SubGraphContext ctx ) {
160
160
final String subTypeName = ctx .subType () == null ? null : ctx .subType ().getText ();
161
161
162
162
if ( PARSING_LOGGER .isDebugEnabled () ) {
0 commit comments