About TypedQuery

51-60 of 143Refresh
JPA Doc
3

javax.persistence.PessimisticLockScope

of the EntityManager, Query, and TypedQuery interfaces that allow lock modes to be specified or used
Forum
3

Object as parameter results in exception

)));   TypedQuery q = getEntityManager().createQuery(c);   List resultList = q.getResultList ... .equal(p.get("owningCompany").get("id"), company.getId())));   TypedQuery q = getEntityManager ... please consider: Building the query (the CriteriaQuery and the TypedQuery) once with two parameters
Forum
3

Performance in large transactions

javax.persistence.OneToMany; import javax.persistence.Persistence; import javax.persistence.TypedQuery ... );   for (int m = 0; m < steps; m++) {    TypedQuery q = em.createQuery("SELECT m FROM MyEntity ... );    em.getTransaction().begin();    TypedQuery q = em.createQuery("SELECT m FROM
Forum
2

Join performance in Objectdb

("Query 1 started.");         ms = System.currentTimeMillis();         TypedQuery q1 = em ... = System.currentTimeMillis();         TypedQuery q2 = em.createQuery(             "SELECT ... ();         TypedQuery q1 = em.createQuery(             "SELECT COUNT(a.id) FROM A a", Long.class
Forum
2

Query results are not up to date for entities, not primitives

generic functions to build generic TypedQuerys. I just realized that the data retrieving up to date if I ... ")   I really need to use my generic functions to build the typedquerys! After such an update queries ... > Updates are done perfectly well. The problem is in the fact that I'm building the typedquerys
Forum
2

Cast exception?

cannot be cast to database.entity.Player From just fetching a single result: TypedQuery query = em ... work around it? You do cast implicitly by using TypedQuery with a Player.class (which might be loaded ... rather than TypedQuery and then check the result type (Player) and its class loader. Check also the class loader
Forum
2

JPA query of a Set of terms

that are already persisted. TypedQuery query = em.createQuery( "SELECT DISTINCT si.page FROM SearchIndex si ... of search terms. For example, for two search terms: TypedQuery query = em.createQuery ... terms; } In that case the query is simpler (and possibly faster): TypedQuery
Forum
2

Left join fetch behaviour doesn't retrieve children?

; import javax.persistence.Persistence; import javax.persistence.TypedQuery; public class ... left join fetch         em = emf.createEntityManager();         TypedQuery query ... using left join fetch   em = emf.createEntityManager();   TypedQuery query = em
Forum
2

New to Product & Having An Issue

()); } @Test public void queryDepById(){ TypedQuery q = em ... ()); this.foundResult = d; } @Test public void queryDepByIdComponents(){ TypedQuery ... void tearDown(){ //Ensure cleanup happens if lookups fail. TypedQuery
Issue
2

Update query bug

Some code. Problem in UPDATE query. TypedQuery> query = (TypedQuery>) em.createQuery("SELECT t FROM Person p JOIN p.transports t WHERE p.personalCode = :code ... ); list.add(temp); TypedQuery query2 = (TypedQuery) em.createQuery("UPDATE Person p