About Persistence Context

api-jpa

JPA Queries

Reference (JavaDoc) of all the JPA query types, including Query, TypedQuery, CriteriaBuilder, CriteriaQuery, Tuple, Root, Expression, Order, etc.... Query and TypedQuery interfaces: javax.persistence.Query javax.persistence.TypedQuery The JPA ... Interface used to interact with the persistence context. See JavaDoc Reference Page... 's getCriteriaBuilder ...

 
forum_thread

Class fields selection to store

In a class how do I define which are the fields to be stored? (using JDO API) It's using persistence-modifier="persistent" ? If I have a class with 40 fields and I only want to store one of the fields should I do the following? <class name="Car">    <field name="Wheels" persistence-modifier="persistent" /> </class> Which are the value used for fields that I do not want to store? ... to be stored? (using JDO API) It's using persistence-modifier="persistent" ? If I have a class with 40 fields ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
forum_thread

mappedBy problem

If I put the mappedBy element to the @OneToMany, the owned side (the many side) will never persist ! for example @Entity public class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Long id; public String name; @OneToMany(targetEntity=Address.class,mappedBy="employee") public List<Address> addresses; }   @Entity... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
forum_thread

Cannot sort descending, when ordering by caluculated float in a method

Hi, I have found an issue in ordering by a method. I have two entities : Invoice and InvoiceItem. public class InvoiceItem{ ..     private float price;     private float amount; .. }   public class Invoice{ ...   import java. util . *; import javax. persistence . *;   public final class F172 { ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
forum_thread

Query on Embedded Primary Key?

Hi, I am trying to use Embedded Primary Key - but seems I can't retrieve them correctly with the query below - the query seem to work fine for other field (in the code = primkeycopy). The error I get when is below - it complains about a casting issue. Let me know how to fix it - Thanks  EKK   ... import java. util . List ; import javax. persistence . Embeddable ; import javax. persistence . ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
issue

New entity objects are duplicated on merge cascading

When merge is cascaded to a new entity object that has not been persisted yet - it becomes persisted twice. This was demonstrated by a Java EE application in this forum thread but may be reproduced also in a simple console test case: ... import java. util . *;   import javax. persistence . *;   @ Entity public class I110 ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
forum_thread

Possible issue with String fields

Hi I'm brand new to objectdb and I'm trying to create an objectdb from a sample db via jdbc. The code all works and for a few thousand records but when I increase the number of records I get the following " ... Exception in thread "main" [ObjectDB 2.3.7_15] javax.persistence.RollbackException Failed to commit transaction: String index out of ... EntityManager's method Clear the persistence context, causing all managed entities to become detached. See JavaDoc ...

 
forum_thread

JPA vs JDO - which is more efficient for OneToMany queries?

I'm curious about the trade offs between JDO and JPA. Seems to me that JDO will perform better and be statically typed. For example: Assume there are Customers and Orders.... See: http://www.objectdb.com/java/jpa/persistence/store#Global_Cascading_Persist and ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
api-jpa

javax.persistence.PersistenceUnit

Expresses a dependency on an EntityManagerFactory and its associated persistence unit.(Annotation of JPA)

 
forum_thread

Queries are slow on a large database

Hi, I have a 12GB database with 787603 entries. It is much larger than usual and there are performances issues. I am doing small queries and they take much longer than I expect, i.e.: Get the total number of entries Get 25 consecutive entries (i.e. 0-25) Get one specific entry On average each query needs 4 to 5 minutes to return a result. I have been adviced to use indexes but they are already used through the JDO Metadata file. For instance I use this class: ... (this.Id) javax.jdo.JDOUserException Invalid context for aggregate 'count' (error 743) (position 0) at ... = "objectdb" key = "index" value = "context" /> </class > I added a new index ... = "objectdb" key = "index" value = "context" /> </class > My class is: ...