title: Spring Data JPA: No property found for type (Field name contains query method predicate keywords)
body: <p>So I've been trying to wrap my brain around this error. So I'm getting a pretty standard error which I understand what it is telling me I just don't see how it's getting this error. So here is the error</p>
  <pre><code>Caused by: org.springframework.data.mapping.PropertyReferenceException: No property stored found for type StorageItemEntity! Did you mean 'storedIn'?
      at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:90) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:437) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:413) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:366) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) ~[na:na]
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:348) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:331) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.repository.query.parser.Part.&lt;init&gt;(Part.java:81) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:249) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
      at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[na:na]
      at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
      at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
      at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
      at org.springframework.data.repository.query.parser.PartTree$OrPart.&lt;init&gt;(PartTree.java:250) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:383) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
      at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[na:na]
      at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
      at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
      at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
      at org.springframework.data.repository.query.parser.PartTree$Predicate.&lt;init&gt;(PartTree.java:384) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.repository.query.parser.PartTree.&lt;init&gt;(PartTree.java:95) ~[spring-data-commons-2.4.8.jar:2.4.8]
      at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.&lt;init&gt;(PartTreeJpaQuery.java:89) ~[spring-data-jpa-2.4.8.jar:2.4.8]
      ... 62 common frames omitted
  </code></pre>
  <p>So pretty standard error right? Ok so it's telling me that no property 'stored' is found for my entity. Makes sense but I can't seem to understand why because I didn't define stored. Alright so here is the query that is messing it all up</p>
  <pre><code>@Repository
  public interface StorageItemDao extends JpaRepository&lt;StorageItemEntity, Long&gt; {
      
      // All other methods omitted for sake of keeping it short
      public List&lt;StorageItemEntity&gt; findAllByStoredIn(StorageType storedIn);
  
  }
  </code></pre>
  <p>And here is the StorageItemEntity class</p>
  <pre><code>@Entity
  @Table(name = &quot;storage_item&quot;)
  public class StorageItemEntity implements Serializable{
  
      /**
       * 
       */
      private static final long serialVersionUID = -5373908574936516693L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = &quot;id&quot;)
      private int id;
      
      @NotEmpty(message = &quot;Storage item name can not be empty&quot;)
      @Size(max = 100, message = &quot;Storage item name can not exceed 100 characters&quot;)
      @Column(name = &quot;name&quot;)
      private String name;
      
      @Range(min = 0, message = &quot;Amount in storage can not be less than 0&quot;)
      @Column(name = &quot;amount&quot;)
      private int amount;
      
      @Range(min = 0, message = &quot;Amount expected in storage per week can not be less than 0&quot;)
      @Column(name = &quot;amount_expected&quot;)
      private int amountExpected;
      
      @NotNull(message = &quot;Storage in type can not be empty&quot;)
      @Column(name = &quot;stored_in&quot;)
      private StorageType storedIn;
      
      @Size(max = 500, message = Constants.ADDITIONAL_INFO_EXCEED)
      @Column(name = &quot;additional_info&quot;)
      private String additionalInfo;
      
      @NotNull(message = &quot;You need to have a vendor associated to this item&quot;)
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumn(name = &quot;vendor_id&quot;, referencedColumnName=&quot;id&quot;)
      private VendorEntity vendor;
      
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumn(name = &quot;type_of_storage_id&quot;, referencedColumnName=&quot;id&quot;)
      private TypeOfStorageEntity typeOfStorage;
  
      // All getters, setters, and constructors are omitted
  }
  </code></pre>
  <p>I would also like to note that StorageType is a pretty standard Enumeration. This is not the error but it is a good note just in case. So why would I be getting a &quot;No property 'stored' found for type StorageItemEntity&quot; if I never defined said stored in my JPA method?</p>
  <p>Thank you</p>