Imagine the following Entity Simple.java:
@Entity
public class Simple {
  Process process;
 
  @Enumerated(EnumType.STRING)
  public void Process getProcess() {
      return process;
  }
}
And Process.java:
public enum Process {
  WHAT,
  THE,
  BUCK
}
Now, I initally thought, that since you are defining the enum type to be string, then you can simply query the database using string as well like this:
entityManager.createQuery("from Simple s where s.process=:process").setParameter("process","WHAT").getResultList();
entityManager.createQuery("from Simple s where s.process=:process").setParameter("process",Process.valueOf("WHAT")).getResultList();
Now the query will run and return your list :-)
 
 

 
 Posts
Posts
 
