About persistence

forum_thread

find() cost unreasonable time!

Hi, I make a full binary tree of 4095 node, I check the first 9 node, but the root cost 24 seconds, why? Result: ... java. util . List ;   import javax. persistence . DiscriminatorColumn ; import javax. persistence . DiscriminatorType ; import javax. persistence . ...

 
forum_thread

Storing objects problem

I want to save this object to database: @Entity public class Device { private String name; private String type; private String ipAddress; private Device parent; @Id private String ID; private String ID_HZMO; @ElementCollection private List<Device> children; }    ... EntityManagerFactory emf = Persistence . createEntityManagerFactory ( ... import java. util . *; import javax. persistence . *;   public class Test { public ... EntityManagerFactory emf = Persistence . createEntityManagerFactory ( "$objectdb/db/test.odb" ...

 
api-jpa

javax.persistence.Transient

Specifies that the property or field is not persistent.(Annotation of JPA)

 
api-jpa

javax.persistence.EmbeddedId

Applied to a persistent field or property of an entity class or mapped superclass to denote a composite primary key that is an embeddable class.(Annotation of JPA)

 
api-jpa

createQuery(qlString)

Create an instance of Query for executing a Java Persistence query language statement.(Method of javax.persistence.EntityManager)

 
manual

JPA / JDO Class Enhancer

The Enhancer is a post compilation tool that improves performance by modifying the byte code of compiled classes after compilation.... : path to input user classes -pu <name> : persistence unit name -s : include sub directories in search ... Use the -pu option with the name of a persistence unit to enhance all the managed classes that are defined in that ...

 
api-jpa

javax.persistence.NamedQueries

Specifies multiple named Java Persistence query language queries.(Annotation of JPA)

 
issue

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

Hello! When the JPA entities are not enhanced the remove of an entry from a @OneToMany collection is not possible. The following java code demonstrates the problem. The statement parentEntity.getChildEntityContainer().remove("01"); does not work with not enhanced JPA entities. ... java. util . Map ;   import javax. persistence . CascadeType ; import javax. persistence . Column ; import javax. persistence . Entity ...

 
forum_thread

Extra uninitialised entities spawned on merge()

In the following, Element is a base entity class, with a bi-directional @ManyToOne-@OneToMany relationship Element owner - List<Element> ownedElements, and Example is a subclass entity with a relationship @OneToOne Element child. ...   import java. util . *; import javax. persistence . *;   public class ... EntityManagerFactory emf = Persistence . createEntityManagerFactory ( ... to the persist() operation. It adds the entity to the persistence context, but instead of adding the original entity instance, it ...

 
forum_thread

Using Enum type in NamedQuery: Field is not found in type

I'm trying to switch an application that worked fine in Hibernate to ObjectDB and am having issues with queries that reference enum types. On my entity object is a static enum public static enum Type {     A,B,C } that is stored in an @Enumerated member variable private Type type; @Enumerated public Type getType() {     return type; } I then try to query this field in the following JPA Named Query ... import java. util . *;   import javax. persistence . *;     public final class F554 { ... EntityManagerFactory emf = Persistence . createEntityManagerFactory ( ...