2626import java .util .List ;
2727
2828import static java .lang .Character .isJavaIdentifierStart ;
29+ import static org .hibernate .processor .util .Constants .ENTITY_GRAPH ;
2930import static org .hibernate .processor .util .Constants .JAVA_OBJECT ;
3031import static org .hibernate .processor .util .Constants .NAMED_QUERY ;
32+ import static org .hibernate .processor .util .Constants .TYPED_QUERY_REFERENCE ;
3133import static org .hibernate .processor .util .TypeUtils .containsAnnotation ;
3234import static org .hibernate .processor .util .TypeUtils .getAnnotationMirror ;
3335import static org .hibernate .processor .util .TypeUtils .getAnnotationValue ;
@@ -107,7 +109,8 @@ private void handleNamedQuery(AnnotationMirror mirror, boolean checkHql) {
107109 ProcessorSessionFactory .create ( context .getProcessingEnvironment (),
108110 context .getEntityNameMappings (), context .getEnumTypesByValue () )
109111 );
110- if ( statement instanceof SqmSelectStatement <?> selectStatement ) {
112+ if ( !isJakartaDataStyle ()
113+ && statement instanceof SqmSelectStatement <?> selectStatement ) {
111114 if ( isQueryMethodName ( name ) ) {
112115 putMember ( name ,
113116 new NamedQueryMethod (
@@ -121,13 +124,12 @@ private void handleNamedQuery(AnnotationMirror mirror, boolean checkHql) {
121124 )
122125 );
123126 }
124- if ( !isJakartaDataStyle ()
125- && getAnnotationValue ( mirror , "resultClass" ) == null ) {
127+ if ( getAnnotationValue ( mirror , "resultClass" ) == null ) {
126128 final String resultType = resultType ( selectStatement );
127129 if ( resultType != null ) {
128130 putMember ( "QUERY_" + name ,
129131 new TypedMetaAttribute ( this , name , "QUERY_" , resultType ,
130- "jakarta.persistence.TypedQueryReference" , hql ) );
132+ TYPED_QUERY_REFERENCE , hql ) );
131133 }
132134 }
133135 }
@@ -207,11 +209,11 @@ private NameMetaAttribute auxiliaryMember(AnnotationMirror mirror, String prefix
207209 // and then we will replace this TypedMetaAttribute
208210 return new TypedMetaAttribute ( this , name , prefix ,
209211 resultClass == null ? JAVA_OBJECT : resultClass .getValue ().toString (),
210- "jakarta.persistence.TypedQueryReference" , null );
212+ TYPED_QUERY_REFERENCE , null );
211213 }
212214 else if ( "GRAPH_" .equals (prefix ) ) {
213215 return new TypedMetaAttribute ( this , name , prefix , getQualifiedName (),
214- "jakarta.persistence.EntityGraph" , null );
216+ ENTITY_GRAPH , null );
215217 }
216218 else {
217219 return new NameMetaAttribute ( this , name , prefix );
0 commit comments