Home » Search

About OneToMany

11-20 of 143Refresh
Forum
23

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
23

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!
Forum
23

Error: Failed to write value of field X using reflection (oneToMany relation)

coche } @Entity public class Cliente extends Persona{ @OneToMany(mappedBy="Pedido ... reflection   What's wrong with this? I suppose i'm making a bad connection on the oneToMany - manyToOne ... . You have to change the value of the mappedBy attribute: @OneToMany(mappedBy="cliente") i.e. specify the field name on the owner side without the class name.  
Forum
22

@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
22

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
22

Bidirectional OneToMany is slow on updated items

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

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
22

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
Manual
19

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