About OneToMany

forum_thread

EntityManager.refresh takes a long time

EntityManager.refresh takes a long time for entity object Person in this code: ... < span class = "code" > @ OneToMany ( mappedBy = "person" , cascade = ... ( ) ;   @ OneToMany ( mappedBy = "person" , cascade = ...

 
forum_thread

persisting object with long[][] arrays of array

Hi, I have an object I am trying to persist (java) - It has several fields of type long[][]. It is taking very long to persist and sometimes never finish - it hangs on getTransaction().commit(); Here is the object: ... . Id ; import javax. persistence . OneToMany ;     @ Entity public class ... public @ Id String id ; @ OneToMany ( fetch = FetchType . EAGER , cascade ...

 
api-jpa

javax.persistence.OneToMany

Defines a many-valued association with one-to-many multiplicity.(Annotation of JPA)

 
forum_thread

significant performance decrease

we are using objected in embedded mode (on OS X and WINDOWS). The database increased now to around 400000 entities of one class (database file size around 1.5 GByte). The response time of standard queries increased with this database size to an unacceptable rate (several seconds compared to around 30% when the number of entities was just half of the current). We tried to optimize the cache settings, current objectdb.conf is: <!-- ObjectDB Configuration --> <objectdb> ... usedSolutionObjectTypeVersion ;   @ OneToMany ( fetch = FetchType . LAZY ) ... ( ) ;   @ OneToMany ( fetch = FetchType . LAZY ) ... ( ) ;   @ OneToMany ( fetch = FetchType . LAZY ) ...

 
manual

JPA Entity Fields

Explains how to define and use primary keys in JPA, including composite and embedded primary keys.... - for references of entity types. OneToMany javax.persistence.OneToMany JPA annotation Defines a many-valued association with ...

 
forum_thread

Mapped (Inverse) LAZY @OneToMany vs. Unmapped LAZY @OneToMany

In the code example below (also attached) I would like to understand why I am able to print to console a lazy @OneToMany mapped field after a finding entity manager closes. There is a switch DO_VIEW_BEFORE_CLOSE, and when it is true the fields are accessed and output before the finding entity manager closes and as expected both a mapped @OneToMany list and an unmapped @OneToMany list are viewable: a.listA_mapped:[{A}[4]"ownedElement1", {A}[5]"ownedElement2"] a.listB_unmapped:[{B}[2]"b1", {B}[3]"b2"] ... to understand why I am able to print to console a lazy @OneToMany mapped field after a finding entity manager closes. There is a switch ... entity manager closes and as expected both a mapped @OneToMany list and an unmapped @OneToMany list are viewable: ...

 
api-jpa

JPA Annotations for Relationships

Reference (JavaDoc) of JPA 2 relationship annotations, including @ManyToMany, @ManyToOne, @OneToMany, @OneToOne, @OrderBy and @MapKey.... javax.persistence.ManyToOne javax.persistence.OneToMany javax.persistence.OneToOne Unlike ORM 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. ... entities are not enhanced the removal of an entry from a @OneToMany collection is not possible. The following java code demonstrates the ... FetchType ; import javax. persistence . OneToMany ; import javax. persistence . Persistence ; ...

 
forum_thread

OneToMany and cascade delete problem

Hi, I don't really know if this is a bug or maybe model that I make is bad. I have a problem with with two different classes with OneToMany relation to one, shared class. For example (first class): @Entity public static class Store { @OneToMany(targetEntity = Offer.class, mappedBy = "store") private List<Offer> offers; } second class: ... bad. I have a problem with with two different classes with OneToMany relation to one, shared class. For example (first class): @ ... static class Store {   @ OneToMany ( targetEntity = Offer. class , mappedBy = ...

 
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.... class Customer { @ OneToMany // the annotation is not required by ObjectDB ... Entity class Customer { @ OneToMany ( mappedBy = "customer" ) ... it, pretty impressive. I used JPA, and the @OneToMany(mappedBy="") on the collection was handled entirely ...