@@ -102,8 +102,8 @@ public class GraphQLJpaSchemaBuilder implements GraphQLSchemaBuilder {
102
102
private Map <Class <?>, GraphQLOutputType > classCache = new HashMap <>();
103
103
private Map <EntityType <?>, GraphQLObjectType > entityCache = new HashMap <>();
104
104
private Map <ManagedType <?>, GraphQLInputObjectType > inputObjectCache = new HashMap <>();
105
- private Map <EmbeddableType <?>, GraphQLObjectType > embeddableOutputCache = new HashMap <>();
106
- private Map <EmbeddableType <?>, GraphQLInputObjectType > embeddableInputCache = new HashMap <>();
105
+ private Map <Class <?>, GraphQLObjectType > embeddableOutputCache = new HashMap <>();
106
+ private Map <Class <?>, GraphQLInputObjectType > embeddableInputCache = new HashMap <>();
107
107
108
108
private static final Logger log = LoggerFactory .getLogger (GraphQLJpaSchemaBuilder .class );
109
109
@@ -206,7 +206,7 @@ private GraphQLFieldDefinition getQueryFieldSelectDefinition(EntityType<?> entit
206
206
.build ();
207
207
}
208
208
209
- private Map <ManagedType <?>, GraphQLArgument > whereArgumentsMap = new HashMap <>();
209
+ private Map <Class <?>, GraphQLArgument > whereArgumentsMap = new HashMap <>();
210
210
211
211
private GraphQLArgument getWhereArgument (ManagedType <?> managedType ) {
212
212
String typeName ="" ;
@@ -218,7 +218,7 @@ private GraphQLArgument getWhereArgument(ManagedType<?> managedType) {
218
218
219
219
String type = namingStrategy .pluralize (typeName )+"CriteriaExpression" ;
220
220
221
- GraphQLArgument whereArgument = whereArgumentsMap .get (managedType );
221
+ GraphQLArgument whereArgument = whereArgumentsMap .get (managedType . getJavaType () );
222
222
223
223
if (whereArgument != null )
224
224
return whereArgument ;
@@ -259,12 +259,12 @@ private GraphQLArgument getWhereArgument(ManagedType<?> managedType) {
259
259
.build ();
260
260
261
261
whereArgument = GraphQLArgument .newArgument ()
262
- .name (QUERY_WHERE_PARAM_NAME )
263
- .description ("Where logical specification" )
264
- .type (whereInputObject )
265
- .build ();
262
+ .name (QUERY_WHERE_PARAM_NAME )
263
+ .description ("Where logical specification" )
264
+ .type (whereInputObject )
265
+ .build ();
266
266
267
- whereArgumentsMap .put (managedType , whereArgument );
267
+ whereArgumentsMap .put (managedType . getJavaType () , whereArgument );
268
268
269
269
return whereArgument ;
270
270
@@ -475,11 +475,11 @@ private GraphQLArgument getArgument(Attribute<?,?> attribute) {
475
475
}
476
476
477
477
private GraphQLType getEmbeddableType (EmbeddableType <?> embeddableType , boolean input ) {
478
- if (input && embeddableInputCache .containsKey (embeddableType ))
479
- return embeddableInputCache .get (embeddableType );
478
+ if (input && embeddableInputCache .containsKey (embeddableType . getJavaType () ))
479
+ return embeddableInputCache .get (embeddableType . getJavaType () );
480
480
481
- if (!input && embeddableOutputCache .containsKey (embeddableType ))
482
- return embeddableOutputCache .get (embeddableType );
481
+ if (!input && embeddableOutputCache .containsKey (embeddableType . getJavaType () ))
482
+ return embeddableOutputCache .get (embeddableType . getJavaType () );
483
483
String embeddableTypeName = namingStrategy .singularize (embeddableType .getJavaType ().getSimpleName ())+ (input ? "Input" : "" ) +"EmbeddableType" ;
484
484
GraphQLType graphQLType =null ;
485
485
if (input ) {
@@ -504,9 +504,9 @@ private GraphQLType getEmbeddableType(EmbeddableType<?> embeddableType, boolean
504
504
.build ();
505
505
}
506
506
if (input ) {
507
- embeddableInputCache .putIfAbsent (embeddableType , (GraphQLInputObjectType ) graphQLType );
507
+ embeddableInputCache .putIfAbsent (embeddableType . getJavaType () , (GraphQLInputObjectType ) graphQLType );
508
508
} else {
509
- embeddableOutputCache .putIfAbsent (embeddableType , (GraphQLObjectType ) graphQLType );
509
+ embeddableOutputCache .putIfAbsent (embeddableType . getJavaType () , (GraphQLObjectType ) graphQLType );
510
510
}
511
511
512
512
return graphQLType ;
0 commit comments