Home » Search

About TypedQuery

61-70 of 139Refresh
Forum
2

java.lang.ClassCastException in OSGi runtime when loading data from DB

that seems to throw the exception: @Override public Person loadPerson(final Integer id) {   TypedQuery typedQuery = entityManager.createQuery("SELECT FROM Person p WHERE p.id = 1", Person.class);   Person singleResult = typedQuery.getSingleResult();   System.out.println(singleResult);   return
Forum
2

ObectDb 2.3.6 in OSGi environment

to call the second bundle in following way with a JUnit Plugin test: TypedQuery query =  (TypedQuery) this.dbService.createNamedQuery("RuleValueNode.findRoot", RuleValueNode.class ... required bundle, and the simple access to the db: @Override public TypedQuery createNamedQuery
Issue
2

Once served to JSF page via @EJB query bean, many list fields are null (but same query ok after fresh persist in @PostConstruct)

): protected void testQuery() { String $i = "testQuery"; TypedQuery query = em ... > findElements() {         String $i = "testQuery";         TypedQuery query = em.createQuery("SELECT ... ";         TypedQuery query = em.createQuery(             "SELECT e FROM Element e", Element
Forum
2

Query on Embedded Primary Key?

.Persistence; import javax.persistence.TypedQuery; @Entity public class OBJ2 implements Serializable ... .getTransaction().commit();         em.clear();         TypedQuery query = em.createQuery ... .getResultList();         String q = ret.get(0).getClass().getCanonicalName();         TypedQuery
Forum
2

Retrieve data of all entity classes in a single query

+ " s"; // This works for all classes TypedQuery query = em.createQuery(tmpQuery ... to use TypedQuery instead of TypedQuery but had casting issues   You can retrieve
Forum
2

Searching lists within objects

);         TypedQuery typedQuery = em.createQuery(q);         List results = typedQuery
Forum
2

Visibility of changes in Transaction is not visible to a JPA QL Query

go to count them; TypedQuery q = em.createQuery("SELECT COUNT(x) FROM Item x", Long.class ... howManyItemsExist(EntityManager em) {   TypedQuery q = em.createQuery("SELECT COUNT(x) FROM Item x", Long ... which) {   TypedQuery q = em.createQuery("SELECT o FROM Item o WHERE o.cachedKey = :cachedKey", Item.class);   q
Forum
1

"where in" query

> results; TypedQuery prezs = em.createQuery("SELECT p FROM Prez p WHERE p.id MEMBER OF :ids ... ();         TypedQuery prezs = em.createQuery(             "SELECT p FROM Prez p WHERE p.id MEMBER
Forum
1

createQuery method error

Hello, I am learning ObjectDB now. I create a simple Dao method as below:   public boolean isJobExist(String name) { TypedQuery query = em.createQuery( "SELECT count(j) FROM ... ] TypedQuery query = em.createQuery( ----------------------------------- Sounds like I
Forum
1

Duplicate Entity class names causes Exception in Query

Item findItem(EntityManager em, int which) { TypedQuery q = em.createNamedQuery("objdbTest ... ; } } public long howManyItemsExist(EntityManager em) { TypedQuery q = em.createNamedQuery("objdbTest