About TypedQuery

51-60 of 139Refresh
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
Issue
2

@FetchGroup in JPA similar to JDO

with only those fields filled with data: TypedQuery query = em.createQuery("SELECT e FROM Entity e", Entity.class ... : TypedQuery query = em.createQuery("select e.firstName, e.lastName FROM Entity e", Tuple ... constructors to Entity and change query to TypedQuery query = em.createQuery("select new
Forum
2

Error 363 - Failed to read value of inverse relationship

; try { TypedQuery query = getEntityManager().createQuery("SELECT p FROM Player p ... getPlayer(String name) {         if (name == null) return null;         try {             TypedQuery ... ) { //        if (playerName == null) return null; //        try { //            TypedQuery query = db
Forum
2

How to use JOIN FETCH?

.TemporalType; import javax.persistence.TypedQuery; public class Eager2 { public static void main ... );   em.getTransaction().commit();   TypedQuery
aq = em.createQuery("select a from Address ... .   TypedQuery q = em.createQuery(         "select p from Person p join fetch p.addressHistory
Forum
2

Internal exception when updating date filed (TemporalType.DATE)

();                 TypedQuery personQuery = entityManager.createQuery ... .persistence.Query; import javax.persistence.Temporal; import javax.persistence.TypedQuery; public class ... .getTransaction().begin(); TypedQuery personQuery = entityManager