About inverse



Defines a single-valued association to another entity that has one-to-one multiplicity.(Annotation of JPA)


Modifier operations

Hi, Today I was reading about different NoSQL databases. One of those database - MongoDB - has a very nice feature, especially for web applications - modifier operations. The whole trick for those operations is to change some value in object without pulling this object from database. So for example we have class: public class WebVisit { public String url; // key public int visitsCount; } As for now I have to pull this class from database: ... If the list is managed as an inverse (mapped by) field - you should be able to use an update query on the ...


Possible issue for JPQL IS EMPTY expression

Possible issue for JPQL IS EMPTY comparison expression: SELECT e FROM MyEntity e WHERE e.collection-valued IS EMPTY throws javax.persistence.PersistenceException: Invalid operand type  for operator IS EMPTY (error 756) Thanks. ... operators are currently not supported for mapped by (inverse) collections. Please see more details and a possible workaround ...


EntityManager.refresh takes a long time

EntityManager.refresh takes a long time for entity object Person in this code: ... includes running many queries in order to refresh all the inverse (mappedBy) collections, and then recursively other objects. Apparently ...


Removing objects where ManyToMany relationships exist

Consider you have an entity Entity with the following unidirectional relationship: @ManyToMany private Set<OtherEntity> setOfOtherEntities; public Set<OtherEntity> getOtherEntities() {     if (setOfOtherEntities == null) {       setOfOtherEntities = new TreeSet<OtherEntity>();     }     return setOfOtherEntities;   } ... It depends. On retrieval - inverse (mapped by) collections are usually slower. On update - they may be ...


Cannot sort descending, when ordering by caluculated float in a method

Hi, I have found an issue in ordering by a method. I have two entities : Invoice and InvoiceItem. public class InvoiceItem{ ..     private float price;     private float amount; .. }   public class Invoice{ ... OK. It seems that mapped by (inverse) fields are unavailable to methods in queries, regardless if the method ...


NullPointer when accessing persistent field

I am afraid this is a large and complex example, and I do not encounter the problem in simple cases, therefore there is no example attached. I appreciate this may make the bug unreproduceable from your end.   ... reproduces the exception. It may be thrown on accessing an inverse collection in an entity that has been garbage collected. ...


[ODB1] Chapter 6 - Persistent Objects

Shows how to store, retrieve, update and delete database objects. ... Notice that unbind( ... ) is not exactly an inverse operation of bind( ... ) , because the object is not deleted from ...


Object explorer cannot open odb file. ObjectDB many-to-many relationship

I created a data model to test many-to-many relationship with a link table as following (full code in attachement) ... Just be aware that navigation from the mapped by (inverse) side to the owner side is slower since it requires query execution. ...


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

We have a big object tree in our project. If I use the entityManage.remove method a entityManager.refresh is necessary in order to have an updated object tree in memory. But entityManager.refresh is too slow for our project. Do you know a possibilty to remove parent/child entities without entityManager.refresh after the entityManager.remove operation? I have searched for a solution with the following unit test (See testRemoveVariant2()). But my approach works correctly. Do you have an idea? ... revised test case demonstrates an ObjectDB bug in handling inverse (mapped by) collections and maps in reflection mode (note that the test ...