About OneToMany

11-20 of 149Refresh
Forum
21

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

{ @OneToMany // the annotation is not required by ObjectDB Vector orders; } @Entity ... me see if I grok this. Using JPA: @Entity class Customer { @OneToMany(mappedBy="customer ... impressive. I used JPA, and the @OneToMany(mappedBy="") on the collection was handled entirely implicitly! dmoshal
Forum
21

OneToMany and cascade delete 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 ... { @OneToMany(targetEntity = Offer.class, mappedBy = "product", fetch = FetchType.LAZY, cascade = CascadeType
Forum
21

@OneToMany(fetch = FetchType.LAZY) list is always null

Hello. @OneToMany(fetch = FetchType.LAZY) doesn't work when using EJB or something else related to J2EE. parent.getChildren() returns null. Here is a simple example: Bean: @Named("test ... ") private int id; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List
Forum
21

how to query by properties of onetomany relations? (Error 990)

(JpaQuery.java:610)   f.bars is: @OneToMany private Set bars; bars.name is just a String ... ();         emf.close();     }         @Entity     public static final class Foo {         @OneToMany
Forum
20

Bidirectional OneToMany is slow on updated items

dramatically, is to avoid using mapped by collections: @OneToMany(cascade = {CascadeType
Forum
20

OneToMany Bidirectional Relationship Problem

Hi, I'm pretty certain I'm doing something stupid. I've read everything I can find on OneToMany in the forum and in the JPA docs, but I can't get it to work with 2.4.0_04. I've attached a testcase. I want the owning object present in the child, (in the example, Team to be in Player). Thanks Paul
Forum
20

Removing an element from an @OneToMany doesn't work

Hello. I have a Parent and Child entities. // in the parent @OneToMany(mappedBy = "parent", fetch = FetchType.EAGER, cascade = CascadeType.ALL) private List children; // in the child @ManyToOne private Parent parent; Somewhere I do this: parent.getChildren().remove(0
Forum
19

Unable to update a OneToMany Set

Unable to update a OneToMany Set
Manual
18

Deleting JPA Entity Objects

cascading mode which can be specified using the orphanRemoval element of the @OneToOne and @OneToMany ... Employee { : @OneToMany(orphanRemoval=true) private List
addresses
Manual
13

Retrieving JPA Entity Objects

@OneToMany or @ManyToMany annotations (currently ObjectDB does not distinguish between the two) enables