I am new to Play, and also to sleep and JPA. I am using MySql DB and JPA I have included
import javax.persistence.Entity; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; import play.db.jpa.JPA; import play.mvc.Controller; import play.db.jpa.*;
I have this request
List languages = FormLanguages.findAll(); render(languages);
Which works correctly, but I want to select based on id, something like this
"select * from FormLanguages, where id> 10"
When I use it like
Query query = JPA.em().createQuery("select * from FormLanguages"); List<FormLanguages> articles = query.getResultList(); render(articles);
Which gives me an IllegalArgumentException error
When using this
List queryList = FormLanguages.em().createQuery("select * from FormLanguages").getResultList(); render(queryList);
which gives the same error please help me how to write a query
Also suggest me some sites
source share