ObjectDB Database Search

1-50 of 137 results

jakarta.persistence.CascadeType

Jakarta Persistence (JPA) Enum jakarta.persistence. CascadeType java.lang.Object ∟ java.lang.Enum ∟ jakarta.persistence. CascadeType Implemented Interfaces: Constable , Comparable , Serializable Defines the set of cascadable operations that are propagated to the associated entity. The value cascade

jakarta.persistence.CascadeType.CascadeType()

Jakarta Persistence (JPA) Constructor in jakarta.persistence. CascadeType CascadeType () Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CascadeType.ALL

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. CascadeType ALL Cascade all operations Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CascadeType.PERSIST

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. CascadeType PERSIST Cascade the persist operation Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CascadeType.MERGE

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. CascadeType MERGE Cascade the merge operation Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CascadeType.REMOVE

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. CascadeType REMOVE Cascade the remove operation Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CascadeType.REFRESH

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. CascadeType REFRESH Cascade the refresh operation Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CascadeType.DETACH

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence. CascadeType DETACH Cascade the detach operation Since: Jakarta Persistence (JPA) 2.0

Detached JPA Entities

to related entities, mark the reference field with CascadeType . DETACH or CascadeType ... = CascadeType . DETACH ) private Address address; : } In the example above, the Employee entity has an address field that references an Address entity. Because the field is marked with CascadeType .DETACH

Deleting JPA Entities

a transaction. Cascading remove Marking a reference field with CascadeType . REMOVE (or CascadeType ... entities that the field references. @Entity class Employee { : @OneToOne ( cascade = CascadeType . REMOVE ... that references an Address entity. Because of the CascadeType .REMOVE setting, when an Employee

orphanRemoval = true not working when CascadeType.REMOVE is disabled

= CascadeType .REMOVE) Address entities used Employee (id=1) deleted, but Address (name_2) using

Storing JPA Entities

with CascadeType . PERSIST (or CascadeType . ALL , which includes PERSIST ) indicates that persist ... can reference multiple entities. @Entity class Employee { : @OneToOne ( cascade = CascadeType . PERSIST ... . Because of the CascadeType .PERSIST setting, when an Employee instance is persisted, the operation is automatically

Retrieving JPA Entities

. Cascading refresh Marking a reference field with CascadeType . REFRESH (or CascadeType ... Employee { : @OneToOne ( cascade = CascadeType . REFRESH ) private Address address; : } In ... , which is another entity class. Because of the CascadeType .REFRESH setting, when an Employee instance

Updating JPA Entities

that are referenced by modified entities through fields that are marked with CascadeType . PERSIST or CascadeType . ALL are also persisted. If global cascade persist is enabled, all reachable entities

JPA Entity Fields

EntityWithFieldSettings { @Basic ( optional =false) Integer field1; @OneToOne ( cascade = CascadeType

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 .ALL) private List operations = new ArrayList (); @ManyToMany(cascade = CascadeType .REFRESH) @NotNull

Persist error @ManyToMany how to define correct entities relationships

; @ManyToMany(cascade= CascadeType .PERSIST) private List categories = new ArrayList(); } @Entity public class ... . CascadeType ; import javax.persistence.Entity; import javax.persistence.EntityManager; import javax ... implements Serializable { @Id //@GeneratedValue private long id; @ManyToMany(cascade= CascadeType .PERSIST

persisting object with long[][] arrays of array

(); Here is the object: import java.io.Serializable; import javax.persistence. CascadeType ; import javax ... ;  @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType .ALL) public long[] time;     @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType .ALL) private long[][] a1;   

How to Remove records from many to many relationship tables in JPA

public class TransportationEvent { ... @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType ... { .... @ManyToMany( fetch = FetchType.LAZY, cascade = CascadeType .PERSIST) private List transportationEvents ... .annotations. CascadeType .DELETE_ORPHAN) and i applied that as @ManyToMany(fetch = FetchType.EAGER, cascade

Merge Issue: Attempt to reuse an existing primary key value

;        CascadeType .ALL         ... ? ( without retrieving child on Db or using other tricks ). Thanks, Xirt Edit : Using CascadeType .MERGE make the test case working ! I think the CascadeType .PERSIST ( included in CascadeType .ALL ) is the problem. In

jakarta.persistence.ManyToMany

using generics. Default: void/class Since: Jakarta Persistence (JPA) 1.0 CascadeType [] cascade

jakarta.persistence.ManyToOne

) 1.0 CascadeType [] cascade (Optional) The operations that must be cascaded to the target

jakarta.persistence.OneToOne

property that stores the association. Default: void/class Since: Jakarta Persistence (JPA) 1.0 CascadeType

jakarta.persistence.OneToMany

Since: Jakarta Persistence (JPA) 1.0 CascadeType [] cascade (Optional) The operations that must be cascaded

ManyToMany Set is null

={ CascadeType . DETACH , CascadeType . MERGE , CascadeType . REFRESH }) @JoinTable(name="PERSON_CONTRACT ... = FetchType. EAGER , cascade={ CascadeType . DETACH , CascadeType . MERGE , CascadeType . REFRESH }, mappedBy

Is it possible to remove parent/child entities without refresh?

.persistence. CascadeType ; import javax.persistence.Column; import javax.persistence.Entity; import javax ... ;   @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType .ALL, mappedBy = "parent ... , cascade = { CascadeType .PERSIST, CascadeType .MERGE, CascadeType .REFRESH })   private ParentEntity

Merge with Parent/Child entities not possible

.util.Map; import javax.persistence. CascadeType ; import javax.persistence.Column; import javax ... , cascade = CascadeType .ALL, mappedBy = "parent", orphanRemoval = true)   @MapKey(name = "childName ... long id;   @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType .PERSIST, CascadeType .MERGE

EntityManager JPA or JDO impl and different behavior

; @OneToMany(cascade= CascadeType .PERSIST, fetch=FetchType.EAGER)         ... ;     }         @OneToMany(cascade= CascadeType ... to the map value." This appears to mean that if I have cascade= CascadeType .ALL on a OneToMany map

jakarta.persistence.OneToOne.cascade

Jakarta Persistence (JPA) Method in jakarta.persistence.OneToOne CascadeType [] cascade (Optional) The operations that must be cascaded to the target of the association. By default no operations are cascaded. Default: {} Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.OneToMany.cascade

Jakarta Persistence (JPA) Method in jakarta.persistence.OneToMany CascadeType [] cascade (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 Map , the cascade element applies to the map value. Default: {} Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.ManyToOne.cascade

Jakarta Persistence (JPA) Method in jakarta.persistence.ManyToOne CascadeType [] cascade (Optional) The operations that must be cascaded to the target of the association. By default no operations are cascaded. Default: {} Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.ManyToMany.cascade

Jakarta Persistence (JPA) Method in jakarta.persistence.ManyToMany CascadeType [] cascade (Optional) The operations that must be cascaded to the target of the association. When the target collection is a Map , the cascade element applies to the map value. Defaults to no operations being cascaded. Default: {} Since: Jakarta Persistence (JPA) 1.0

EM.find() is suddenly slower

= { CascadeType .REFRESH, CascadeType .DETACH }) private ModelElementImpl element; @OneToMany (fetch = FetchType.EAGER, cascade = { CascadeType .REFRESH, CascadeType .DETACH }) private HashMap mappingMap = new

Embedded Entity in EmbeddedId not persisted. Error 631 at select.

; em.getTransaction().commit(); or by specifying CascadeType .PERSIST: @Embeddable public static class AId {     @OneToOne(cascade = CascadeType .PERSIST)     public B b; Apparently the @Embedded annotation works as  CascadeType .PERSIST , although B

Left join fetch behaviour doesn't retrieve children?

(i guess ?). import java.util.HashSet; import java.util.Set; import javax.persistence. CascadeType ... = MyEntityChild.class, cascade = CascadeType .ALL)         public ... . CascadeType ; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.OneToOne

Fields in objects not populated in query result.

= CascadeType .ALL) private Map children = new TreeMap (); private String path;      [assorted ... id; private String name; private String description; @ManyToOne(cascade= CascadeType .PERSIST) private Folder parent; private boolean listable; @ManyToMany(cascade= CascadeType .ALL) private Map

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

, generator = "b") private int id; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType ... Parent { // ...id @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType .ALL) private ByteData bydaData ... = GenerationType.AUTO) private int id; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType .ALL) private OTO

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

;     @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType .ALL)    ... ; @OneToMany(fetch = FetchType.LAZY, mappedBy = "a", cascade = CascadeType .ALL)     ... = FetchType.LAZY, cascade = CascadeType .ALL)         List listB

Is it ok to put list or map of embeddable objects in entity ?

Serializable { (...) @OneToMany(cascade = CascadeType .ALL) List entityCList; } Where EntityC is some ... to have removed all EntityB classes also (which are part of EmbeddableB with CascadeType .ALL). And that's not ... ;@OneToMany(cascade = CascadeType .ALL)     List embeddableBList; } It is not

Mysterious "Attempt to persist a reference to a non managed instance" error

javax.persistence. CascadeType .*; import static javax.persistence.FetchType.*; @Entity public class ... @ManyToMany(cascade = { CascadeType .ALL}, targetEntity = Passenger.class, mappedBy = "buses")   private Set passengers= new HashSet();   Passenger.class @ManyToMany(cascade = { CascadeType

Apparent Lazy Loading issues.

element apply to the map value." This appears to mean that if I have cascade= CascadeType ... to have CascadeType .ALL. The test created the AttributeNames via the dao prior to trying to persist. The list ... about trying to reuse a primary key for AttributeName. So I removed the CascadeType .All from Holder

Double persist of Entity field with Cascade.ALL

I am building a JavaEE application using Netbeans 7.0.1, Glassfish 3.1 and ObjectDB 2.3.3. I have a Book class with entity field Chapter which has a CascadeType .ALL property. The Book fields are as ... bookTitle; @OneToMany(cascade= CascadeType .ALL, fetch= FetchType.EAGER) private List chapters; The Chapter

Multiple Collection Fields not update correctly

to another entity and they both reciprocally do: EntityB:     @OneToOne(cascade = CascadeType ... = CascadeType .ALL)     EntityB entityB;   If I make only one of the cascade, then this bug

Optimistic locking: prevent version increment on entity collection attribute

", cascade= CascadeType .PERSIST)     private List readings = new ArrayList ... = 0; @Id private long id = ID_SEQ++; @OneToMany(mappedBy="document", cascade= CascadeType .PERSIST

Tracking changes to new collections (in enhancement mode) after flush

= "uid") private String uid; @OneToOne (fetch = FetchType.EAGER, cascade = { CascadeType .REFRESH, CascadeType .DETACH }) private ModelElementImpl element; @OneToMany (fetch = FetchType.EAGER, cascade = { CascadeType .REFRESH, CascadeType .DETACH }) private HashMap mappingMap = new HashMap (1); (edited

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

; } @Override public void setId(Long id) { this.id = id; } @OneToMany(cascade={ CascadeType .MERGE, CascadeType .PERSIST}, mappedBy="account", fetch = FetchType.LAZY) @JoinColumn(name = "project_id", unique=true ... ; @OneToMany(cascade={ CascadeType .MERGE, CascadeType .PERSIST},        

NullPointerException when using multithreading

private String secondId; @OneToOne(cascade= CascadeType .ALL) private HashMap myMap; } @Embeddable public class EmbeddableA { @OneToOne(cascade= CascadeType .ALL) private HashMap myMap; } @Embeddable public class EmbeddableB { @OneToOne(cascade= CascadeType .ALL) private HashMap myMap; } I'm am trying

Best practise loading big data

.persistence . Basic ; import javax.persistence . CascadeType ; import javax.persistence ... ; @OneToMany (cascade = CascadeType . ALL , targetEntity = MyStepBlock . class , fetch = FetchType ... (cascade = CascadeType . ALL , targetEntity = MyStep . class , fetch = FetchType . LAZY ) ArrayList steps

New entity objects are duplicated on merge cascading

;       @OneToMany(cascade= CascadeType .ALL, fetch= FetchType.EAGER ... ;    @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType .ALL)     ... ;  @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType .ALL)      

ClassCastException after upgrade to 2.3.5_03

, cascade= CascadeType .ALL, fetch=FetchType.EAGER) private Object payload; @OneToOne(orphanRemoval=true, cascade= CascadeType .ALL, fetch=FetchType.EAGER) private Map metadata; ... In this case the "payload