About getSingleResult

manual

Running JPA Queries

Explains how to use JPA to run Java Persistence Query Language (JPQL) queries.... for running SELECT queries: Query.getSingleResult getSingleResult() Query's method Execute a SELECT query that ...

 
api-jpa

getSingleResult()

Execute a SELECT query that returns a single untyped result.(Method of javax.persistence.Query)

 
api-jpa

getSingleResult()

Execute a SELECT query that returns a single result.(Method of javax.persistence.TypedQuery)

 
forum_thread

_PersistenceException: Type is not found on getSingleResult.

Greetings. I'm new to ObjectDB. I'm using an ObjectDB local database for a Java SE standalone application and i'm having issues querying for an object of this entity: #1 2013-06-07 16:36 Greetings. I'm new to ObjectDB. I'm using an ObjectDB local database for a Java SE standalone app ...

 
manual

Query Parameters in JPA

Explains how to use parameters (named parameters and ordinal parameters) in JPA queries.... Page... ( "name" , name ) . getSingleResult getSingleResult() TypedQuery's method Execute a SELECT query that ...

 
manual

CRUD Database Operations with JPA

Shows how to use Java/JPA to store, retrieve, update & delete.... out . println ( "Total Points: " + q1. getSingleResult getSingleResult() Query's method Execute a SELECT query that ...

 
forum_thread

Remove a modified entity cause an optimistic lock exception

Hello, the following examples load and modify an entity, and load and remove the same entity. The first example 'SetAndRemoveIssue.java' is a simple java program which executes without errors. The second example is an OSGi program which fails with an optimistic lock exception. Both examples are equivalent, please execute SetAndRemoveIssue.java (in the OSGi example as a plugin-test). Can you explain the optimistic lock exception? ... e = (MyEntity)em.createQuery("select m from MyEntity m").getSingleResult();         ... e = (MyEntity)em.createQuery("select m from MyEntity m").getSingleResult();         ...

 
manual

Setting and Tuning of JPA Queries

Explains various JPA query settings - result range, flush and lock.... typed List. See JavaDoc Reference Page... or getSingleResult getSingleResult() TypedQuery's method Execute a SELECT query that ...

 
forum_thread

Performance in large transactions

Hello, we have a performance problem when we use a large transaction. Let's do exactly the same in several transactions the ObjectDB works much faster. In our use case, we create many new entities and between the creations we call a select query. The execution of the query becomes slower at each iteration. (In the query, we search for an item of type Entity2. However, there is only one entity.)   Pseudocode for the fast and the slow solution FAST: ... // the "problem" Query Entity2 x = //query (getSingleResult): "select e from Entity2 e where e.start <= "+i+" AND "+i+" ... // the "problem" Query Entity2 x = //query (getSingleResult): "select e from Entity2 e where e.start <= "+i+" AND "+i+" ...

 
api-jpa

javax.persistence.TypedQuery

Interface used to control the execution of typed queries.(Interface of JPA)