@@ -102,8 +102,8 @@ public class GraphQLJpaSchemaBuilder implements GraphQLSchemaBuilder {
102102 private Map <Class <?>, GraphQLOutputType > classCache = new HashMap <>();
103103 private Map <EntityType <?>, GraphQLObjectType > entityCache = new HashMap <>();
104104 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 <>();
107107
108108 private static final Logger log = LoggerFactory .getLogger (GraphQLJpaSchemaBuilder .class );
109109
@@ -206,7 +206,7 @@ private GraphQLFieldDefinition getQueryFieldSelectDefinition(EntityType<?> entit
206206 .build ();
207207 }
208208
209- private Map <ManagedType <?>, GraphQLArgument > whereArgumentsMap = new HashMap <>();
209+ private Map <Class <?>, GraphQLArgument > whereArgumentsMap = new HashMap <>();
210210
211211 private GraphQLArgument getWhereArgument (ManagedType <?> managedType ) {
212212 String typeName ="" ;
@@ -218,7 +218,7 @@ private GraphQLArgument getWhereArgument(ManagedType<?> managedType) {
218218
219219 String type = namingStrategy .pluralize (typeName )+"CriteriaExpression" ;
220220
221- GraphQLArgument whereArgument = whereArgumentsMap .get (managedType );
221+ GraphQLArgument whereArgument = whereArgumentsMap .get (managedType . getJavaType () );
222222
223223 if (whereArgument != null )
224224 return whereArgument ;
@@ -259,12 +259,12 @@ private GraphQLArgument getWhereArgument(ManagedType<?> managedType) {
259259 .build ();
260260
261261 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 ();
266266
267- whereArgumentsMap .put (managedType , whereArgument );
267+ whereArgumentsMap .put (managedType . getJavaType () , whereArgument );
268268
269269 return whereArgument ;
270270
@@ -475,11 +475,11 @@ private GraphQLArgument getArgument(Attribute<?,?> attribute) {
475475 }
476476
477477 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 () );
480480
481- if (!input && embeddableOutputCache .containsKey (embeddableType ))
482- return embeddableOutputCache .get (embeddableType );
481+ if (!input && embeddableOutputCache .containsKey (embeddableType . getJavaType () ))
482+ return embeddableOutputCache .get (embeddableType . getJavaType () );
483483 String embeddableTypeName = namingStrategy .singularize (embeddableType .getJavaType ().getSimpleName ())+ (input ? "Input" : "" ) +"EmbeddableType" ;
484484 GraphQLType graphQLType =null ;
485485 if (input ) {
@@ -504,9 +504,9 @@ private GraphQLType getEmbeddableType(EmbeddableType<?> embeddableType, boolean
504504 .build ();
505505 }
506506 if (input ) {
507- embeddableInputCache .putIfAbsent (embeddableType , (GraphQLInputObjectType ) graphQLType );
507+ embeddableInputCache .putIfAbsent (embeddableType . getJavaType () , (GraphQLInputObjectType ) graphQLType );
508508 } else {
509- embeddableOutputCache .putIfAbsent (embeddableType , (GraphQLObjectType ) graphQLType );
509+ embeddableOutputCache .putIfAbsent (embeddableType . getJavaType () , (GraphQLObjectType ) graphQLType );
510510 }
511511
512512 return graphQLType ;
0 commit comments