org.springframework.data.mapping.PropertyReferenceException: No property øreAndÅr found for type org.springframework.data.repository.query.parser.PartTreeUnitTests$DomainObjectWithSpecialChars

Spring JIRA | Aleksander Blomskøld | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Parsing of query methods with special characters fails in some cases. For instance, given this class: {code:java} class DomainObjectWithSpecialChars { Long id; String år; String øre; } {code} And the following repository: {code:java} interface DomainObjectWithSpecialChars Repository extends JpaRepository<DomainObjectWithSpecialChars , Long> { DomainObjectWithSpecialChars findByØreAndÅr(String øre, String år); } {code} Initialization then fails with the following exception: {noformat} org.springframework.data.mapping.PropertyReferenceException: No property øreAndÅr found for type org.springframework.data.repository.query.parser.PartTreeUnitTests$DomainObjectWithSpecialChars at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:74) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:326) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:306) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:244) at org.springframework.data.repository.query.parser.Part.<init>(Part.java:73) at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180) at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260) at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240) at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:71) {noformat} The reason for this problem is the use of US-ASCII-based regex matchers (i.e. {{[a-z]}}, \p{Uppper}, etc.) when creating the {{PartTree}}. Changing to unicode character matches (\p{Lu} and \p{Ll}) solves the issue.

    Spring JIRA | 5 years ago | Aleksander Blomskøld
    org.springframework.data.mapping.PropertyReferenceException: No property øreAndÅr found for type org.springframework.data.repository.query.parser.PartTreeUnitTests$DomainObjectWithSpecialChars
  2. 0

    Parsing of query methods with special characters fails in some cases. For instance, given this class: {code:java} class DomainObjectWithSpecialChars { Long id; String år; String øre; } {code} And the following repository: {code:java} interface DomainObjectWithSpecialChars Repository extends JpaRepository<DomainObjectWithSpecialChars , Long> { DomainObjectWithSpecialChars findByØreAndÅr(String øre, String år); } {code} Initialization then fails with the following exception: {noformat} org.springframework.data.mapping.PropertyReferenceException: No property øreAndÅr found for type org.springframework.data.repository.query.parser.PartTreeUnitTests$DomainObjectWithSpecialChars at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:74) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:326) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:306) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:244) at org.springframework.data.repository.query.parser.Part.<init>(Part.java:73) at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180) at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260) at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240) at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:71) {noformat} The reason for this problem is the use of US-ASCII-based regex matchers (i.e. {{[a-z]}}, \p{Uppper}, etc.) when creating the {{PartTree}}. Changing to unicode character matches (\p{Lu} and \p{Ll}) solves the issue.

    Spring JIRA | 5 years ago | Aleksander Blomskøld
    org.springframework.data.mapping.PropertyReferenceException: No property øreAndÅr found for type org.springframework.data.repository.query.parser.PartTreeUnitTests$DomainObjectWithSpecialChars
  3. 0

    Error in query in Jpa with SpringBoot

    Stack Overflow | 2 years ago | Soham
    org.springframework.data.mapping.PropertyReferenceException: No property UserId found for type User!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    No property getMaterials found for type Material! and Error creating bean with name 'materialRepository':

    Stack Overflow | 2 years ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'materialResource': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.htd.repository.MaterialRepository com.htd.web.rest.MaterialResource.materialRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'materialRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property getMaterials found for type Material!
  6. 0

    How to use @NamedQuery in spring a CrudRepository @Query?

    Stack Overflow | 2 years ago | membersound
    org.springframework.data.mapping.PropertyReferenceException: No property findAllCustom found for type MyEntity!

  1. Dunmer 2 times, last 6 days ago
  2. batwalrus76 2 times, last 1 month ago
  3. Omya 2 times, last 2 months ago
  4. SteVio1989 2 times, last 2 months ago
  5. kjhdofjosvs 9 times, last 4 months ago
2 more registered users
10 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.data.mapping.PropertyReferenceException

    No property øreAndÅr found for type org.springframework.data.repository.query.parser.PartTreeUnitTests$DomainObjectWithSpecialChars

    at org.springframework.data.mapping.PropertyPath.<init>()
  2. Spring Data Core
    PartTree.<init>
    1. org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:74)
    2. org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:326)
    3. org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:306)
    4. org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270)
    5. org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:244)
    6. org.springframework.data.repository.query.parser.Part.<init>(Part.java:73)
    7. org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180)
    8. org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260)
    9. org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240)
    10. org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:71)
    10 frames