About setParameter

81-90 of 98Refresh
Issue
1

NullpointerException at a normal select

When I run the following code: EntityManager em = getEm(); Customer result = null; try {     logger.debug("Ident: "+ident);     result = em.createQuery("Select c from Customer c where c.identifier=:id", Customer.class).setParameter("id", ident).getSingleResult(); } catch (javax.persistence
Forum
1

Object comparation never matches

)                 .setParameter("principal", authentication.getPrincipal()).getSingleResult
Forum
1

Online backup problem

. You may try:     Query query = em.createQuery("objectdb backup");     query.setParameter("dummy", "dummy
Forum
1

ORDER BY problem, when String starts with language specific character

.getNormName()");         query.setParameter("names", Arrays.asList("a", "c"));         List resultList
Forum
1

Performance in SELECT statement

, TestEntity.class); query.setParameter("state", EnumSet.of(State.NEW, State.ACKNOWLEDGED)); List
Forum
1

Problems down-casting in WHERE clause

");         query.setParameter("search", "");         query.getResultList();         em.close
Forum
1

query on calendar class

=em.createQuery("SELECT c FROM Cdr c where c.start.DAY_OF_WEEK = ?1",Cdr.class); query.setParameter
Forum
1

Query with FETCH JOIN returns multiple results instead of one.

") .setParameter("demand", demand).getResultList(); I want this query to find one and only Demand object
Forum
1

Restrict by class in query

I have the following bit of code: public List findFolderByName(String folderName) { TypedQuery byNameQuery = this.entityManager.createQuery("SELECT f FROM Entry f WHERE f.name=:name", Folder.class); return byNameQuery.setParameter("name", folderName).getResultList(); } I
Forum
1

Should derived fields of an EmbeddedId be manually maintained by app code?

.setParameter("container", this); q.setFlushMode(FlushModeType.AUTO); try { long l = (Long) q