Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-1160

jpaMappingContext cannot be initialized cause my property has upper case letters

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Works as Designed
    • 2.0 RC2 (Kay)
    • None
    • None
    • OS:Fedora 26
      Tomcat:8.0.44
      JDK:1.8.0_131
      Spring Framework:5.0.0.RC3

    Description

      Here is part of my model

      @Entity
      @Table(name = "patient")
      public class Patient extends AbstactPatient implements IPatient,CreatorEntity {
      
          @ManyToOne(fetch = FetchType.LAZY)
          @JoinColumn(nullable = false)
          @JsonIgnore
          private Hospital hospital;
      
          @Column(columnDefinition = "text", updatable = true)
          public String name;
      
          @Enumerated(EnumType.ORDINAL)
          @Column(length = 10)
          public HBsAgEnum HBsAg;
          .....
      }
      

      when i upgrade the spring data version from Ingalls-SR6 to Kay-RC2 (also the spring framework version from 4 to 5), my server cannot start cause the AbstractPersistentProperty use PropertyPath to fetch the type information, and in PropertyPath, line 86

          String propertyName = name.matches(ALL_UPPERCASE) ? name : 
          StringUtils.uncapitalize(name);
          TypeInformation<?> propertyType = owningType.getProperty(propertyName);
      
          if (propertyType == null) {
              throw new PropertyReferenceException(propertyName, owningType, base);
          }
      

      so what should i do with the code? Change the property name to hBsAg?

      Attachments

        Activity

          People

            olivergierke Oliver Drotbohm
            ethan.zhao Ethan Zhao
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: