title: Spring Data error Caused by: org.hibernate.QueryException: could not resolve property
body: <p>My application throws the error while starting </p>
  
  <p>Caused by: org.hibernate.QueryException: could not resolve property: version of: org.mycompany.system.model.Code </p>
  
  <p>My repository method </p>
  
  <pre><code>@Query("SELECT NEW org.mycompany.util.CodeVO(c.id,  c.description,c.version) FROM Code c where  c.groupName = :groupName")
      List&lt;CodeVO&gt; getByGroupName(@Param("groupName") String groupName);
  </code></pre>
  
  <p>Base class</p>
  
  <pre><code>public abstract class ModelObject&lt;ID extends Serializable&gt; implements Serializable {
  
      @Column(nullable = false, length = 100)
      private String createdBy;
  
      @Column(nullable = false)
      private LocalDateTime createdTime = LocalDateTime.now();
  
      @Version
      private int version;
  
      public String getCreatedBy() {
          return createdBy;
      }
  
      public void setCreatedBy(String createdBy) {
          this.createdBy = createdBy;
      }
      public int getVersion() {
          return version;
      }
  
      public void setVersion(int version) {
          this.version = version;
      }
  
  }
  </code></pre>
  
  <p>Sub class</p>
  
  <pre><code> @Entity
  @Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "groupName", "description" }) })
  public class Code extends ModelObject&lt;Long&gt; {
  
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id; 
  
      @Column
      @NotBlank
      private String description;
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  }
  </code></pre>
  
  <p>is it not possible to refer superclass properties?</p>