title: Hibernate could not resolve property of the Embedded class
body: <p>I have an Embeddable class, which is embedded in an entity.</p>
  
  <pre><code>@Embeddable
  public class RawObservation{
   @NotNull
      @Column(name="RAW_CODE")
      private String rawCode;
  </code></pre>
  
  <p>//getters,setters
      }</p>
  
  <pre><code>@Entity
      public class TankObservation{
      @Embedded
          private RawObservation rawObservation;
      }
  </code></pre>
  
  <p>When I try to make a GET query with "rawCode" parameter;</p>
  
  <p>Hiberanate throws following exception[1];</p>
  
  <p>How can I overcome this?</p>
  
  <pre><code>Caused by: org.hibernate.QueryException: could not resolve property: rawCode of: com.abc.TankObservation
      at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:62)
      at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:56)
      at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1770)
      at org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:46)
      at org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1745)
      at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:510)
      at org.hibernate.loader.criteria.CriteriaQueryTranslator.findColumns(CriteriaQueryTranslator.java:525)
      at org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:66)
      at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:400)
      at org.hibernate.loader.criteria.CriteriaJoinWalker.&lt;init&gt;(CriteriaJoinWalker.java:106)
      at org.hibernate.loader.criteria.CriteriaJoinWalker.&lt;init&gt;(CriteriaJoinWalker.java:75)
      at org.hibernate.loader.criteria.CriteriaLoader.&lt;init&gt;(CriteriaLoader.java:80)
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1760)
      at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
      at com.cdi.crud.infra.Crud.list(Crud.java:437)
      at com.cdi.crud.infra.CrudService.paginate(CrudService.java:128)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
  </code></pre>
  
  <p><strong>Edit :</strong></p>
  
  <pre><code>public Criteria configPagination(Filter&lt;TankObservation&gt; filter) {
    if (filter.getEntity() != null) {
  
  
          if(filter.getEntity().getRawObservation().getRawCode() != null){
              crud().eq("rawCode", filter.getEntity().getRawObservation().getRawCode());
          }
  
          if(filter.getEntity().getRawObservation().getProductCode() != null){
              crud().eq("productCode", filter.getEntity().getRawObservation().getProductCode());
          }
  
  
  }
  
    return crud().getCriteria();
  }
  </code></pre>