Skip to content

Fails on bean properties starting with upper case #172

@pierrefoyard

Description

@pierrefoyard

Hi,
My Database contains columns starting with uppercase (for example "Folder_ID").
We keep these column names in JPA beans, so we have beans like:

@Getter
public class MyBean {
  private Integer Folder_Id;
}

This leads to fatal exception in GraphQLSchemaFactoryBean at parsing stage.
I get this issue with 0.3.28 and 0.3.29-SNAPSHOT.
In debug mode I noticed that this problem comes from the fact that in GraphQLJpaSchemaBuilder::getEntityAttributesFields we loop on entity attributes (attribute name is "Folder_Id" in my example). Then in sub function IntrospecutionUtils::isIgnored, we search for attribute name in descriptors map built in EntityIntrospectionResult based on beanInfo;getPropertyDescriptors. This map is built based on getter names and removes first upper case letter (except when the second lettre is also in upper case). So this map contains an entry "folder_Id" and because we cannot find our attribute name we get an exception.

Best regards,

Pierre.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions