Internal Website Search

1-50 of 163 results

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

to console a lazy @ OneToMany mapped field after a finding entity manager closes. There is a switch DO_VIEW ... manager closes and as expected both a mapped @ OneToMany list and an unmapped @ OneToMany list ... ; @ OneToMany (fetch = FetchType.LAZY, mappedBy = "a", cascade = CascadeType.ALL)    

JPA Entity Fields

- for references of entity types. OneToMany , ManyToMany - for collections and maps of entity types ... ; @ OneToMany ( fetch = FetchType . EAGER ) List field3; } The entity class declaration ... { String name; @ManyToOne Department department; } @Entity public class Department { @ OneToMany

javax.persistence.OneToMany

JPA Annotation OneToMany Target: METHOD, FIELD Implemented Interfaces: Annotation Specifies a many ... of the relationship. The OneToMany annotation may be used within an embeddable class contained within an entity ... Customer class: @ OneToMany (cascade=ALL, mappedBy="customer") public Set getOrders() { return orders

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") private List offers; } second class: @Entity public static class Product { @ OneToMany (targetEntity

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

Persona{ @ OneToMany (mappedBy="Pedido.cliente") public List pedidos; } The class Persona ... connection on the oneToMany - manyToOne. But I can't figure it out. Someone can help me? elnll002 ... You have to change the value of the mappedBy attribute: @ OneToMany (mappedBy="cliente") i.e. specify the field

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

definition is valid in JPA: @Entity class Customer { @ OneToMany // the annotation is not required by ... this. Using JPA: @Entity class Customer { @ OneToMany (mappedBy="customer") Vector orders; }   ... other operations. support Support wow - just tried it, pretty impressive. I used JPA, and the @ OneToMany (mappedBy

@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 ... , generator = "b") private int id; @ OneToMany (fetch = FetchType.LAZY, cascade = CascadeType

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

is: @ OneToMany private Set bars; bars.name is just a String in my test database i have one Foo entity ... class Foo {         @ OneToMany (cascade=CascadeType.PERSIST)  

javax.persistence.OneToMany.orphanRemoval

JPA Annotation Attribute in javax.persistence. OneToMany boolean orphanRemoval default false (Optional) Whether to apply the remove operation to entities that have been removed from the relationship and to cascade the remove operation to those entities. Since: JPA 2.0

javax.persistence.OneToMany.fetch

JPA Annotation Attribute in javax.persistence. OneToMany FetchType fetch default LAZY (Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entities must be eagerly fetched

javax.persistence.OneToMany.mappedBy

JPA Annotation Attribute in javax.persistence. OneToMany String mappedBy default "" The field that owns the relationship. Required unless the relationship is unidirectional. Since: JPA 1.0

javax.persistence.OneToMany.cascade

JPA Annotation Attribute in javax.persistence. OneToMany CascadeType [] cascade default {} (Optional) The operations that must be cascaded to the target of the association. Defaults to no operations being cascaded. When the target collection is a java.util.Map , the cascade element applies to the map value. Since: JPA 1.0

javax.persistence.OneToMany.targetEntity

JPA Annotation Attribute in javax.persistence. OneToMany Class targetEntity default void.class (Optional) The entity class that is the target of the association. Optional only if the collection property is defined using Java generics. Must be specified otherwise. Defaults to the parameterized type of the collection when defined using generics. Since: JPA 1.0

Memory use in OneToMany relationships

Hello everyone, I have a question regarding the OneToMany / ManyToOne Relationship in ObjectDB. So imaging following setup: We have class A which holds an collection (List, Arrray ...) of class B. In a more usual DB like MySQL with a seperate server we first query for the Entitys of class

Bidirectional OneToMany is slow on updated items

: @ OneToMany (cascade = {CascadeType.ALL}, fetch = FetchType.LAZY/*, mappedBy = "person"*/) private Set

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); manager.merge(parent

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

Unable to update a OneToMany Set

Unable to update a OneToMany Set

Deleting JPA Entity Objects

which can be specified using the orphanRemoval element of the @OneToOne and @ OneToMany annotations: @Entity ... for collection and map fields. For example: @Entity class Employee { : @ OneToMany ( orphanRemoval

Retrieving JPA Entity Objects

) private Collection projects; : } Specifying FetchType . EAGER explicitly in @ OneToMany or @ManyToMany

Inverse OneToMany Mapping and EmbeddedId

.persistence . Id ; import javax.persistence . ManyToOne ; import javax.persistence . OneToMany ... ; objectdb-2.9.0_03  *   *         issue: Inverse @ OneToMany (mappedBy ... : Is it possible to map Entitys inverse OneToMany if this are  *        

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 removal of an entry from a @ OneToMany collection ... javax.persistence. OneToMany ; import javax.persistence.Persistence; import org.junit.Assert; public ... {   @ OneToMany (fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)  

EntityManager.refresh takes a long time

relationsto itself with a cascade refresh: @ OneToMany (mappedBy = "person", cascade = CascadeType.ALL) private List openIdAuths = new ArrayList (); @ OneToMany (mappedBy = "person", cascade = CascadeType ... = CascadeType.REFRESH) @NotNull private List selectedMePersons = new ArrayList (); @ OneToMany (mappedBy

significant performance decrease

; @ OneToMany (fetch=FetchType.LAZY) public List actions = new ArrayList (); @ OneToMany (fetch=FetchType.LAZY) public List childNodes = new ArrayList (); @ OneToMany (fetch=FetchType.LAZY) public List container ... (fetch=FetchType.LAZY) public ObjectNode currentOperation; @ OneToMany (fetch=FetchType.LAZY) public List

persisting object with long[][] arrays of array

.persistence. OneToMany ; @Entity public class TESTObject implements Serializable{     ... ;  @ OneToMany (fetch = FetchType.EAGER, cascade = CascadeType.ALL) public long[] time;     @ OneToMany (fetch = FetchType.EAGER, cascade = CascadeType.ALL) private long[][] a1;   

javax.persistence.MapKeyJoinColumn

public class Company { @Id int id; ... @ OneToMany // unidirectional @JoinTable(name="COMPANY ... is for a map key for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the foreign key column is in a join table. If the join is for a OneToMany entity

javax.persistence.JoinColumn

one-to-many association using a foreign key mapping // In Customer class @ OneToMany @JoinColumn(name="CUST ... ;} See Also: ManyToOne OneToMany OneToOne JoinTable CollectionTable ForeignKey Since: JPA 1.0 Public Annotation ... entity or embeddable. If the join is for a unidirectional OneToMany mapping using a foreign key mapping

Error 613 - i cant put a list into a Squad object

. OneToMany ; @Entity public class Squad {     private int squadId;     @ OneToMany ()     private List athlets;     public ... .persistence. OneToMany ; @Entity public class Athlet extends Person implements Serializable {   

Optimistic locking: prevent version increment on entity collection attribute

seem to have some issues. I have changed my classes to have a OneTomany mappedBy relationship as follows ... ;  @Id private long id;        @ OneToMany (mappedBy="document")    ... static long ID_SEQ = 0; @Id private long id = ID_SEQ++; @ OneToMany (mappedBy="document") private

Lazy loading does not work - crud takes long

tomee7.0.0SNAPSHOT,objectdb 2.6.4 The OneToMany Entities are filled with 40.000 Records and they have between 20-40 Columns. It takes over 50s to load all Project Enities that contains the OneToMany ... ; @ OneToMany (cascade = CascadeType.ALL, orphanRemoval = true, mappedBy="project",fetch = FetchType.LAZY)  

Error 363 - Failed to read value of inverse relationship

{ @Id private String id; @ OneToMany (mappedBy="town") private Set events; public Set getEvents() { Set ... List postedMessages = new ArrayList (); @ OneToMany (mappedBy = "address") private List ... (); private String text; @ OneToMany (/*fetch=FetchType.LAZY, cascade=CascadeType.ALL, */mappedBy

javax.persistence.MapKeyColumn

value. If the map key is for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the map key column is in a join table. If the map key is for a OneToMany entity ... . If the map key is for a OneToMany or ManyToMany entity relationship using a join table, the name

javax.persistence.MapKeyClass

annotations ( OneToMany or ManyToMany ). The MapKey annotation is not used when MapKeyClass is specified ... { @Id int id; ... @ OneToMany (targetEntity=com.example.VicePresident.class) @MapKeyClass(com.example ... are defaulted @Entity public class Company { @Id int id; ... @ OneToMany Map organization

javax.persistence.ManyToOne

of the object being referenced. If the relationship is bidirectional, the non-owning OneToMany entity ... is bidirectional, the non-owning OneToMany entity side must use the mappedBy element of the OneToMany ... ; // Bidirectional } @Entity public class ProgramManager { @Id int id; @ OneToMany (mappedBy="jobInfo

javax.persistence.MapKeyJoinColumn.table

is for a map key for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the foreign key column is in a join table. If the join is for a OneToMany entity ... of the collection table for the map value. If the map is for a OneToMany or ManyToMany entity

Missing (null) elements in eager loaded references

has a OneToMany relationship to DataElement. Every relationship is eagerly fetched   Problem ... extends BaseCostElement { @ OneToMany (mappedBy = "parent" , fetch = FetchType. EAGER ) private List ... extends BaseCostElement { @ OneToMany (mappedBy = "parent" , fetch = FetchType. EAGER ) private List

EntityManager JPA or JDO impl and different behavior

; @ OneToMany (cascade=CascadeType.PERSIST, fetch=FetchType.EAGER)         ... ;     }         @ OneToMany (cascade=CascadeType ... only at the database id.   Second issue. The docs at: http://www.objectdb.com/api/java/jpa/ OneToMany state

javax.persistence.MapKeyEnumerated

with the ElementCollection , OneToMany , or ManyToMany annotation. If the enumerated type is not ... getProjects() {...} @ OneToMany @MapKeyEnumerated(STRING) public Map getEmployees() {...} ... } See Also: ElementCollection OneToMany ManyToMany Since: JPA 2.0 Public Annotation Attributes EnumType value

javax.persistence.MapKeyJoinColumn.name

or for a OneToMany entity relationship using a join table, the foreign key column is in a join table. If the join is for a OneToMany entity relationship using a foreign key mapping strategy

javax.persistence.MapKeyColumn.table

, the name of the collection table for the map value. If the map key is for a OneToMany or ManyToMany ... is for a OneToMany entity relationship using a foreign key mapping strategy, the name of the primary table of the entity that is the value of the map. Since: JPA 2.0

javax.persistence.MapKey

. Example 1: @Entity public class Department { ... @ OneToMany (mappedBy="department") @MapKey // map key ... () { ... } ... } Example 2: @Entity public class Department { ... @ OneToMany (mappedBy="department") @MapKey

javax.persistence.MapKeyColumn.name

. If the map key is for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the map key column is in a join table. If the map key is for a OneToMany entity relationship

javax.persistence.OrderColumn

reordering affecting the list. The OrderColumn annotation is specified on a OneToMany or ManyToMany ... . Example: @Entity public class CreditCard { @Id long ccNumber; @ OneToMany // unidirectional @OrderColumn

javax.persistence.Convert

.class) Map responsibilities; Example 6: Apply a converter to a map key of basic type @ OneToMany ... to an embeddable that is a map key for a relationship @ OneToMany @Convert(attributeName="key.jobType

javax.persistence.JoinColumn.table

. If the join is for a unidirectional OneToMany mapping using a foreign key mapping strategy ... bidirectional ManyToOne/ OneToMany mapping using a join table, the name of the join table. If the join

javax.persistence.JoinColumn.name

is in the table of the source entity or embeddable. If the join is for a unidirectional OneToMany ... . If the join is for a ManyToMany mapping or for a OneToOne or bidirectional ManyToOne/ OneToMany mapping

javax.persistence.MapKeyTemporal

, OneToMany , or ManyToMany annotation. Example: @ OneToMany @MapKeyTemporal(DATE) protected java.util

javax.persistence.FetchType

ManyToMany OneToMany ManyToOne OneToOne Since: JPA 1.0 Enum Constants EAGER Defines that data

javax.persistence.JoinColumn.referencedColumnName

of the target entity. When used with a unidirectional OneToMany foreign key mapping, the referenced column

Best practise loading big data

a boolean flag. @Entity class MyStepBlockCollection { @ OneToMany ( cascase = ALL , fetch = Lazy , target = MyStepBlock } ArrayList stepBlocks; } @Entity class MyStepBlock { @ OneToMany ( cascase ... { @ OneToMany ( cascase = ALL , fetch = Lazy , target = MyStepBlock } ArrayList stepBlocks; } @Entity