About inverse

manual

JPA Entity Fields

Explains how to define and use primary keys in JPA, including composite and embedded primary keys.... fields Persistent fields Inverse (Mapped By) fields Primary key (ID) fields ... The first three groups (transient, persistent and inverse fields) can be used in both entity classes and embeddable classes ...

 
issue

Lazy loading of mapped by (inverse) singular references

... ObjectDB ignores lazy setting of non collection mapped by (inverse) fields and loads them always eagerly. This is allowed by JPA since ... entity objects, so it is always available. For mapped by (inverse) reference fields no information is stored in the entity object and ...

 
issue

Bulk load of eager mapped by (inverse) relationships

When a collection of objects is retrieved by ObjectDB (e.g. by a query) ordinary referenced objects and collection of objects that have to be loaded eagerly are loaded in bulk for better performance. However, inverse (mapped by) references that have to be loaded eagerly currently do not participate in a bulk load, which means that every reference requires running a separate query and doing a separate client-server round trip. Future versions of ObjectDB should load eager mapped by (inverse) fields in bulk as well. ... loaded in bulk for better performance. However, inverse (mapped by) references that have to be loaded eagerly currently do not ... Future versions of ObjectDB should load eager mapped by (inverse) fields in bulk as well. ObjectDB Support ...

 
forum_thread

Cascading persistence through an inverse field

Hi! I was playing with cascading persistence with @ManyToMany and inverse @ManyToMany fields, and I noticed that I can only get cascading persistence in one direction. If the "owner" of the relationship is persistent, then objects that are added to the relationship are automatically made persistent. However, I can not get this to work the other way around. I would also like the relationship owner to be persisted if a persisted object is added on the owner side. I have included a minimal example: ... with cascading persistence with @ManyToMany and inverse @ManyToMany fields, and I noticed that I can only get cascading ... maintain a regular link on both sides instead of using an inverse field? Thank you for your help.   ...

 
forum_thread

Error 363 - Failed to read value of inverse relationship

I've got two objects: @Entity public class EEvent { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @ManyToOne(optional=false) private ETown town; public ETown getTown() { return town; } public void setTown(ETown town) { this.town = town; } } And: ... objects works fine and the relationships (both forward and inverse) behave as expected in the Object DB Explorer, however when I try to ... Some times other field is the problem that inverse mapped like possibleFriends. What's the problem? ...

 
forum_thread

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

In the code example below (also attached) I would like to understand why I am able to print to console a lazy @OneToMany mapped field after a finding entity manager closes. There is a switch DO_VIEW_BEFORE_CLOSE, and when it is true the fields are accessed and output before the finding entity manager closes and as expected both a mapped @OneToMany list and an unmapped @OneToMany list are viewable: a.listA_mapped:[{A}[4]"ownedElement1", {A}[5]"ownedElement2"] a.listB_unmapped:[{B}[2]"b1", {B}[3]"b2"] ... of ObjectDB the entity snapshot didn't include inverse (mapped by) fields, but currently it does (it may be changed again in future versions), so currently inverse relationships are always loaded eagerly in entity classes that are not ...

 
issue

JPQL support for mapped by (inverse) collections

As discussed and demonstrated in this forum thread, collection methods (IS EMPTY, SIZE, MEMBER OF, IN) are not supported for mapped by (inverse) collections.   ... MEMBER OF, IN) are currently not supported for mapped by (inverse) collections. These operations are supported for direct (not ...

 
forum_thread

How storage works?

I have one Class Car that contains a ArrayList of Wheels. I have already one Car with 4 Wheels attached stored in the DB. If I update my Car adding a new Wheel object is all the Car updated? Or only changed part is updated? By other words, If I have one complex data model and only one part is changed, the Object DB stored the all complex data model or only the changed part? Thanks ... Therefore, if the collection is annotated as inverse (mapped by) the entity object in which the collection is defined ... (Wheel). If the collection is not defined as inverse (mapped by) the entity object in which the collection is defined has to ...

 
forum_thread

Performance in large transactions

Hello, we have a performance problem when we use a large transaction. Let's do exactly the same in several transactions the ObjectDB works much faster. In our use case, we create many new entities and between the creations we call a select query. The execution of the query becomes slower at each iteration. (In the query, we search for an item of type Entity2. However, there is only one entity.)   Pseudocode for the fast and the slow solution FAST: ... em. close ( ) ; Embedded vs. Inverse Collections  One of the differences between ObjectDB and ... In these test cases it would be better to use conventional inverse (mapped by) collection in MyEntity : @ Entity ...

 
release

2.5.1

... . Added error message when using mapped by (inverse) collections and maps of invalid types. Changed JOIN ... #197 ). Fixed a bug in loading mapped (inverse) to-many relationship into an array field ([]) ( issue #195 ). ...