26
26
import java .util .List ;
27
27
28
28
import static java .lang .Character .isJavaIdentifierStart ;
29
+ import static org .hibernate .processor .util .Constants .ENTITY_GRAPH ;
29
30
import static org .hibernate .processor .util .Constants .JAVA_OBJECT ;
30
31
import static org .hibernate .processor .util .Constants .NAMED_QUERY ;
32
+ import static org .hibernate .processor .util .Constants .TYPED_QUERY_REFERENCE ;
31
33
import static org .hibernate .processor .util .TypeUtils .containsAnnotation ;
32
34
import static org .hibernate .processor .util .TypeUtils .getAnnotationMirror ;
33
35
import static org .hibernate .processor .util .TypeUtils .getAnnotationValue ;
@@ -107,7 +109,8 @@ private void handleNamedQuery(AnnotationMirror mirror, boolean checkHql) {
107
109
ProcessorSessionFactory .create ( context .getProcessingEnvironment (),
108
110
context .getEntityNameMappings (), context .getEnumTypesByValue () )
109
111
);
110
- if ( statement instanceof SqmSelectStatement <?> selectStatement ) {
112
+ if ( !isJakartaDataStyle ()
113
+ && statement instanceof SqmSelectStatement <?> selectStatement ) {
111
114
if ( isQueryMethodName ( name ) ) {
112
115
putMember ( name ,
113
116
new NamedQueryMethod (
@@ -121,13 +124,12 @@ private void handleNamedQuery(AnnotationMirror mirror, boolean checkHql) {
121
124
)
122
125
);
123
126
}
124
- if ( !isJakartaDataStyle ()
125
- && getAnnotationValue ( mirror , "resultClass" ) == null ) {
127
+ if ( getAnnotationValue ( mirror , "resultClass" ) == null ) {
126
128
final String resultType = resultType ( selectStatement );
127
129
if ( resultType != null ) {
128
130
putMember ( "QUERY_" + name ,
129
131
new TypedMetaAttribute ( this , name , "QUERY_" , resultType ,
130
- "jakarta.persistence.TypedQueryReference" , hql ) );
132
+ TYPED_QUERY_REFERENCE , hql ) );
131
133
}
132
134
}
133
135
}
@@ -207,11 +209,11 @@ private NameMetaAttribute auxiliaryMember(AnnotationMirror mirror, String prefix
207
209
// and then we will replace this TypedMetaAttribute
208
210
return new TypedMetaAttribute ( this , name , prefix ,
209
211
resultClass == null ? JAVA_OBJECT : resultClass .getValue ().toString (),
210
- "jakarta.persistence.TypedQueryReference" , null );
212
+ TYPED_QUERY_REFERENCE , null );
211
213
}
212
214
else if ( "GRAPH_" .equals (prefix ) ) {
213
215
return new TypedMetaAttribute ( this , name , prefix , getQualifiedName (),
214
- "jakarta.persistence.EntityGraph" , null );
216
+ ENTITY_GRAPH , null );
215
217
}
216
218
else {
217
219
return new NameMetaAttribute ( this , name , prefix );
0 commit comments