Internal Website Search

51-100 of 196 results

Persist error @ManyToMany how to define correct entities relationships

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

Merge Issue: Attempt to reuse an existing primary key value

object share the same child on a ManyToMany relationship with Cascade .ALL constraint. public final class ... ;     @ManyToMany( cascade = {          ... class A {         @OneToMany( cascade =CascadeType.ALL)   

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 ... ", column 'conclusions_id' by searching some forums i got syntax like @ Cascade (org.hibernate

Optimistic locking: prevent version increment on entity collection attribute

", cascade =CascadeType.PERSIST)     private List readings = new ArrayList (); The cascade mode is required in order to persist the Reading instances with the Document   ... . support Support Ok, thank you for that. I have cascade persist set at the database configuration

EntityManager JPA or JDO impl and different behavior

; @OneToMany( cascade =CascadeType.PERSIST, fetch=FetchType.EAGER)         ... ;     }         @OneToMany( cascade =CascadeType ... : "When the collection is a java.util.Map, the cascade element and the orphanRemoval element apply

Issue with orphanRemoval and multiple EntityManagers

;   @OneToMany( cascade =CascadeType.ALL, fetch=FetchType.EAGER, orphanRemoval=true)   ... ; } } Your test demonstrated 2 issues: Duplication of new objects during cascading merge - this is a known issue . You may subscribe to it, and until it is solved use workarounds (i.e. avoiding cascading merge

OptimisticLockException

automatically cascade the refresh (ie for collections held by the object modified)? Can cascading ... that you still may see optimistic lock exceptions. Cascading refresh is set by annotations . support Support ... every query (whether modified or not), but I'm not annotating cascading refreshes. ie: I think I

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

it. 2) You have to persist both unless you have automatic cascade persist. In JDO all fields cascade ... discusses which API should be preferred. support Support For JPA, how does one set automatic cascade ... /jpa/persistence/store#Global_ Cascading _Persist and https://www.objectdb.com/java/jpa/setting

Items in list are doubled, when the entity class is not enhanced

;          cascade = CascadeType.ALL,orphanRemoval=true) List ... (which has never been detached). According to JPA - the merge operation is ignored for Customer - but cascaded to Item ... because of cascading from Customer . The result is 2 Item instances - the one that you have built

Eclipse plugin problem (using ObjectDB as a separate bundle)

St Clair Clarke In JPA (unlike JDO) persist is not cascaded automatically to referenced objects by ... by ObjectDB - otherwise you get this exception. Alternatively, you can turn cascading persist ... . I am using JDO. I have NOT written one line of JPA code!! Setting all cascade -persist properties

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

;  @OneToOne(fetch=EAGER, cascade =PERSIST) public Ostrich ostrich;     @ManyToMany( cascade =ALL) public Map entries;     public Index(Ostrich ostrich, Map entries) {   ... .commit();     } } I had started with the expectation that the cascading annotations

ObjectDB JDO - foreign key constraints

cascading updates and deletes in JDO? There seems to exist a @ForeignKey annotation in JDO ... deleting an object but keeping a reference to it). Regarding cascading operations, even if you use JDO you can still use JPA annotations to set cascading operations. Alternatively you may be able to listen

collection of embedded objects

the parent @Entity , does the remove cascade through the whole collection? 3. Is searching ... doesn't cascade operations unless it is explicitly required. Since you cannot specify cascade in @ElementCollection you will have to annotate the embedded collection with @ OneToMan y to cascade

Database Inconsistency or corruption

are annoted with Cascade .ALL. That is, when merging an ObjectValue, the merge operation is propagated ... has a problem with cascade , so I persisted manually all referenced Attributes and the corresponding values ... ( cascade =javax.persistence.CascadeType.ALL, fetch =   javax.persistence.FetchType.EAGER

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

Serializable { (...) @OneToMany( cascade = CascadeType.ALL) List entityCList; } Where EntityC is some ... happening... Is that a bug or are cascade operations not supported with Embeddable classes ? kborkowski ... ;@OneToMany( cascade = CascadeType.ALL)     List embeddableBList; } It is not

Remove not working

.j(TVS.java:169) at com.objectdb.o.TVS. cascade (TVS.java:156) at com.objectdb.o.TVS.g(TVS.java:105 ... (); emf.close(); } @Entity public static class A { @OneToMany(mappedBy="a", cascade =CascadeType ... because the removal of A is cascaded to removal of a B instance that has already been removed earlier in

Multiple Collection Fields not update correctly

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

Storing objects problem

= interfaceMy;   } } } kiki Kristijan Your code persists only the root object. If you want to cascade ... adding an annotation to a reference:   @OneToMany( cascade =CascadeType.PERSIST)   private List children; You may also specify cascading persist globally as explained in the manual. support Support

Dirty checking

. and, having to manually save each one. Question: What's the best way to cascade persistence of Entities ... . Please use a new forum thread to discuss cascading , as it is not directly related to the subject ... which have to be tracked independantly, so I'll just make them Entities instead. will move cascading

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

before commit. Annotate the athletes collection using  @OneToMany( cascade =CascadeType.PERSIST). Annotate the athletes collection using @OneToMany( cascade =CascadeType.ALL). Set global automatic cascading persist . See the Storing JPA Entity Objects page in the ObjectDB manual for more details. support Support

Updating Entities

done to paygradeDB cascade into employeeDB? DragonRulerX Jared Hinze Please try to demonstrate the issue ... can unify the databases when there is a modification made that needs to cascade throughout the entire ... why the changes weren't cascading as I had expected them to. I came up with this idea and it worked... Main

Fields in objects not populated in query result.

Serializable { /** * */ private static final long serialVersionUID = 1L; @OneToMany( cascade ... id; private String name; private String description; @ManyToOne( cascade =CascadeType.PERSIST) private Folder parent; private boolean listable; @ManyToMany( cascade =CascadeType.ALL) private Map

objectdb-2.6.9_02 (with "objectdb.temp.no-enhancement-crc-check") vs. generic classes with interfaces: detailed investigation

.TVS. cascade (TVS.java:156) at com.objectdb.o.STA.Q(STA.java:476) at com.objectdb.o.STM.E(STM.java:411 ... .TVS.j(TVS.java:169) at com.objectdb.o.TVS. cascade (TVS.java:156) at com.objectdb.o.STA.Q(STA.java:476 ... ().begin(); em.persist(project); //rely on Cascade all on ownedElements. The reported error

mappedBy problem

class will never persist !!   eml W M Lao There was a bug in cascading operations through inverse ... it. You will have to add cascade =CascadeType.PERSIST to the mapped by field, unless you have global persist cascade enabled. support Support Using Build 07, I persist Employee  and the Address

A lot of ENT and SIV instances which are not cleared by GC

) at com.objectdb.o.TVS. cascade (TVS.java:156) at com.objectdb.o.TVS.g(TVS.java:105) at com.objectdb.o.TVS.g ... another ones. Also I've added cascade =CascadeType.DETACH or CascadeType ... and fixed (in build 2.6.1_01) a bug in cascading detach through mapped by to-many relationships

@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

Left join fetch behaviour doesn't retrieve children?

= MyEntityChild.class, cascade = CascadeType.ALL)         public ... fetch + various jpa collection combinaison + various cascade combinaison + merge / persist parents ... = MyEntityChild.class, cascade = CascadeType.ALL,mappedBy = "myEntity") // Test by adding / remove

Apparent Lazy Loading issues.

/OneToMany state: "When the collection is a java.util.Map, the cascade element and the orphanRemoval element apply to the map value." This appears to mean that if I have cascade =CascadeType.ALL on a OneToMany map, then the cascade ONLY applies to the values, NOT to the key. This means all keys

ManyToMany Set is null

@GeneratedValue     private long id;     @ManyToMany(fetch = FetchType. EAGER , cascade ... = FetchType. EAGER , cascade ={CascadeType. DETACH ,CascadeType. MERGE ,CascadeType. REFRESH }, mappedBy

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

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

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

TreeSet and compareTo() issue

Martin Thank you for the test case. Please note that cascading persist should be added to make the test valid:     @OneToMany(fetch = FetchType.EAGER, cascade =CascadeType.PERSIST

Global way to set Lazy-loading fetch functionality for all the fields

Hi, for cascading persist, I have 3 choices: - Either locally (@OneToOne( cascade =CascadeType.PERSIST)) - Either at objectdb level ( ) - Either at JPA global level (orm.xml).   For defining fetch policy, I know the local way to do it (@ManyToOne(fetch=FetchType.LAZY)). Is there any way

How to delete M2M relationship?

;  private Long id;     @ManyToMany(mappedBy = "attendees", cascade = CascadeType.ALL)     @ Cascade (org.hibernate.annotations.CascadeType.ALL)  

Persisting collection where members are subclasses

been persisted. You have to persist every entity object explicitly unless cascading persist  is enabled ... ;         @OneToMany( cascade =CascadeType.PERSIST)    

EM.find() is suddenly slower

.FIELD) @Column (name = "uid") private String uid; @OneToOne (fetch = FetchType.EAGER, cascade ... = FetchType.EAGER, cascade = {CascadeType.REFRESH, CascadeType.DETACH }) private HashMap mappingMap = new

@Column( name = "columnName") doesn't work

, cascade = CascadeType.ALL) @Column( name = "DATA_ITEMS" ) private List dataItems; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) private AfwCodedDataBlock codedDataBlock; private int level

Entity not removed 100%

When I remove an object from a class it get's removed but the other objects that had that object as an attribute still keep it although I am using @OneToMany( cascade =CascadeType ... unknown It is the application responsibility to clear references to removed objects. Cascading removal

significant performance decrease

) public List precessors = new ArrayList (); @OneToMany(fetch=FetchType.LAZY, cascade =CascadeType.REMOVE ... = new ArrayList (); @OneToMany(fetch=FetchType.LAZY, cascade =CascadeType.REMOVE) public List

can't get HashMap out of the database

signingDate;     @OneToMany(fetch=FetchType.EAGER, cascade =CascadeType ... .EAGER, cascade =CascadeType.ALL)     private ArrayList guests = new ArrayList

Some details about db behavior

will refer to it. Please explain what is happening there? I know about cascade option, and if I use ... class) after persisting a B instance that references an A instance (with cascading enabled

NullPointer when accessing persistent field

(CLT.java:156) at com.objectdb.o.TVS.j(TVS.java:169) at com.objectdb.o.TVS. cascade (TVS.java:156) at com ... as follows; @OneToMany( cascade =CascadeType.ALL, mappedBy="z_component") @MapKey(name="z_schemeName ... .TVS.j(TVS.java:169) at com.objectdb.o.TVS. cascade (TVS.java:156) at com.objectdb.o.STA.Q(STA.java

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 ... uid; @OneToOne (fetch = FetchType.EAGER, cascade = {CascadeType.REFRESH, CascadeType.DETACH }) private

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

objectdb-2.6.9_06: Extended Persistence Context fails: 'Attempt to begin a new transaction when a transaction is active'

ExtProjectBuilder, which using a serious of cascading lazy builder methods (with complex entity building ... ]"); // Would normally do other builder stuff here and wiring // of entities using cascading lazy creation methods ... do other builder stuff here for project .. // before using in other cascading lazy creation methods. } return

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

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 ... ; @OneToMany( cascade ={CascadeType.MERGE, CascadeType.PERSIST},        

ArrayIndexOutOfBoundException

without no reference to another entity. These entities are not persist in cascade , but explicitly by calling persist ... sure wheather this annotation is allowed when not cascade persist is used? The exception occurs

Best practise loading big data

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