title: JPA createQuery where condition does not work
body: <p>I am trying to use JPA to fetch records from database. However I am able to insert records indatabse and even get all the records using createQuery method of class EntityManager.</p>
  <p>But in below case I am not getting why the condition in where clause is not working.</p>
  <p>Please help me figure it out.</p>
  <p>POJO class :</p>
  <pre><code>@Entity
  @Table(name = &quot;frameworks_filter&quot;)
  public class FilteredFrameworksDbStructure {
  
      @Id
      @Column(name=&quot;id&quot;)
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
      
      @Column(name = &quot;regular_name&quot;)
      private String regularName;
      
      @Column(name = &quot;component_name&quot;)
      private String componentName;
      
      @Column(name = &quot;component_owner&quot;)
      private String componentOwner;
      
      @Column(name = &quot;frameworks&quot;)
      private String frameworks;
      
      public int getId() {
          return id;
      }
      public void setId(int id) {
          this.id = id;
      }
      public String getRegularName() {
          return regularName;
      }
      public void setRegularName(String regularName) {
          this.regularName = regularName;
      }
      public String getComponentName() {
          return componentName;
      }
      public void setComponentName(String componentName) {
          this.componentName = componentName;
      }
      public String getComponentOwner() {
          return componentOwner;
      }
      public void setComponentOwner(String componentOwner) {
          this.componentOwner = componentOwner;
      }
      public String getFrameworks() {
          return frameworks;
      }
      public void setFrameworks(String frameworks) {
          this.frameworks = frameworks;
      }
  }
  </code></pre>
  <p>DAO class method:</p>
  <pre><code>public List&lt;FilteredFrameworksDbStructure&gt; getFilteredFrameworks(String regularName) {
  
          EntityManager entityManager = entityManagerFactory.createEntityManager();
          
          List&lt;FilteredFrameworksDbStructure&gt; filteredFrameworksDbStructureList = entityManager
                  .createQuery(&quot;from FilteredFrameworksDbStructure F where F.regularName = :regular&quot;, FilteredFrameworksDbStructure.class)
                  .setParameter(&quot;regular&quot;, regularName)
                  .getResultList();
          
  
          return filteredFrameworksDbStructureList;
      }
  </code></pre>
  <p>Issue : Condition in where clause does not work. It simply fetch all the records irrespective of the regularName provided.</p>
  <p>Regards,
  Parag Vinchurkar</p>