2222import org .hibernate .reactive .query .sql .spi .ReactiveNamedNativeQueryMemento ;
2323import org .hibernate .reactive .query .sql .spi .ReactiveNamedSqmQueryMemento ;
2424
25+ import jakarta .persistence .TypedQueryReference ;
26+
2527public class ReactiveNamedObjectRepositoryImpl implements NamedObjectRepository {
2628
2729 private final NamedObjectRepository delegate ;
@@ -31,12 +33,17 @@ public ReactiveNamedObjectRepositoryImpl(NamedObjectRepository delegate) {
3133 }
3234
3335 @ Override
34- public NamedSqmQueryMemento getSqmQueryMemento (String queryName ) {
36+ public <R > Map <String , TypedQueryReference <R >> getNamedQueries (Class <R > resultType ) {
37+ return delegate .getNamedQueries ( resultType );
38+ }
39+
40+ @ Override
41+ public NamedSqmQueryMemento <?> getSqmQueryMemento (String queryName ) {
3542 return wrapSqmQueryMemento ( delegate .getSqmQueryMemento ( queryName ) );
3643 }
3744
3845 @ Override
39- public void visitSqmQueryMementos (Consumer <NamedSqmQueryMemento > action ) {
46+ public void visitSqmQueryMementos (Consumer <NamedSqmQueryMemento <?> > action ) {
4047 delegate .visitSqmQueryMementos ( action );
4148 }
4249
@@ -46,12 +53,12 @@ public void registerSqmQueryMemento(String name, NamedSqmQueryMemento descriptor
4653 }
4754
4855 @ Override
49- public NamedNativeQueryMemento getNativeQueryMemento (String queryName ) {
56+ public NamedNativeQueryMemento <?> getNativeQueryMemento (String queryName ) {
5057 return wrapNativeQueryMemento ( delegate .getNativeQueryMemento ( queryName ) );
5158 }
5259
5360 @ Override
54- public void visitNativeQueryMementos (Consumer <NamedNativeQueryMemento > action ) {
61+ public void visitNativeQueryMementos (Consumer <NamedNativeQueryMemento <?> > action ) {
5562 delegate .visitNativeQueryMementos ( action );
5663 }
5764
@@ -101,11 +108,11 @@ public void validateNamedQueries(QueryEngine queryEngine) {
101108 }
102109
103110 @ Override
104- public NamedQueryMemento resolve (
111+ public NamedQueryMemento <?> resolve (
105112 SessionFactoryImplementor sessionFactory ,
106113 MetadataImplementor bootMetamodel ,
107114 String registrationName ) {
108- return wrap (delegate .resolve ( sessionFactory , bootMetamodel , registrationName ));
115+ return wrap ( delegate .resolve ( sessionFactory , bootMetamodel , registrationName ) );
109116 }
110117
111118 @ Override
@@ -118,17 +125,19 @@ public void close() {
118125 delegate .close ();
119126 }
120127
121- private static NamedQueryMemento wrap (final NamedQueryMemento namedQueryMemento ) {
128+ private static NamedQueryMemento <?> wrap (final NamedQueryMemento <?> namedQueryMemento ) {
122129 if ( namedQueryMemento == null ) {
123130 return null ;
124- } else if ( namedQueryMemento instanceof NamedSqmQueryMemento ) {
125- return wrapSqmQueryMemento ( (NamedSqmQueryMemento ) namedQueryMemento );
126- } else {
127- return wrapNativeQueryMemento ( (NamedNativeQueryMemento ) namedQueryMemento );
131+ }
132+ else if ( namedQueryMemento instanceof NamedSqmQueryMemento ) {
133+ return wrapSqmQueryMemento ( (NamedSqmQueryMemento <?>) namedQueryMemento );
134+ }
135+ else {
136+ return wrapNativeQueryMemento ( (NamedNativeQueryMemento <?>) namedQueryMemento );
128137 }
129138 }
130139
131- private static NamedSqmQueryMemento wrapSqmQueryMemento (final NamedSqmQueryMemento sqmQueryMemento ) {
140+ private static NamedSqmQueryMemento <?> wrapSqmQueryMemento (final NamedSqmQueryMemento <?> sqmQueryMemento ) {
132141 if ( sqmQueryMemento == null ) {
133142 return null ;
134143 }
@@ -141,7 +150,7 @@ else if ( sqmQueryMemento instanceof ReactiveNamedSqmQueryMemento ) {
141150 }
142151 }
143152
144- private static NamedNativeQueryMemento wrapNativeQueryMemento (final NamedNativeQueryMemento nativeQueryMemento ) {
153+ private static NamedNativeQueryMemento <?> wrapNativeQueryMemento (final NamedNativeQueryMemento <?> nativeQueryMemento ) {
145154 if ( nativeQueryMemento == null ) {
146155 return null ;
147156 }
0 commit comments