About persist

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; }    ... Device dev : deviceList ) { em. persist ( dev ) ; }   em. ... ) . begin ( ) ; em. persist ( router ) ; em. getTransaction ( ...

 
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: ... parent = new Nodes ( ) ; em. persist ( parent ) ; queue. add ( parent ) ... left. setParent ( cur ) ; em. persist ( left ) ; ++ iNum ; Nodes right = new ...

 
api-jpa

javax.persistence.Transient

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

 
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. ObjectDB Enhancer is a post compilation tool that improves performance by modifying the byte code of compiled classes after compilation. Enhancement is mainly for user-defined persistable classes ( entity classes , embeddable classes and mapp ...

 
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

javax.persistence.NamedQueries

Specifies multiple named Java Persistence query language queries.(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)

 
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. ... ) . begin ( ) ; entityManager. persist ( parentEntity ) ; entityManager. getTransaction ... = new MyEntity ( ) ; em. persist ( e ) ; em. getTransaction ( ) ...

 
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. ... {   final static boolean DO_PERSIST_BEFORE_MERGE = true ;   /** * @param args ... ( null , "root" ) ; em. persist ( root ) ; em. getTransaction ( ...

 
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 #1 2013-01-17 22:17 I'm trying to switch an application that worked fine in Hibernate to ObjectDB and am having issues with queri ...