About empty
Collections in JPQL and Criteria Queries
Shows how collections and maps can be used in JPQL queries.... covers the following topics: IS [NOT] EMPTY SIZE [NOT] MEMBER [OF] [NOT] ... Collection Expressions IS [NOT] EMPTY The IS [NOT] EMPTY operator checks whether a specified collection ...
InternalError on query of empty database
Hi, I have reasons for sometimes trying to query the database before anything has been created. The problem is the database throws a InternalException when that happens. Is it possible to throw something that identifies that that is the issue, say something like "MissingSchemaException", ie something that clearly shows its because no data of that type has been added? This just makes the exception catching cleaner. Thought thinking about it, it probably needs to be a JPA exception, maybe something like javax.persistence.EntityNotFoundException? ... I'm now getting an empty set returned on empty database. Thanks!!!! edit ...
Empty query results after JAR creation
Hi, I struggle with a strange issue. I've embedded ObjectDB in a small application to query cases. Within Netbeans everything works fine but when I create a JAR File and executed via "Java -Jar xyz.jar", I get either empty results or on some cases a "NoResultException" which appears to report the same issue. I've created a small test case (attached zip file) with sample DB to reproduce the issue. ... File and executed via "Java -Jar xyz.jar", I get either empty results or on some cases a "NoResultException" which appears to ... 2012-04-24 05:58 Empty results or NoResultException may be caused by accessing an empty ...
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. ... Possible issue for JPQL IS EMPTY comparison expression: SELECT e FROM MyEntity e WHERE e.collection-valued IS EMPTY throws javax.persistence.PersistenceException: Invalid ...
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"] ... the mapped list gives null and the unmapped list gives an empty list [], when DO_VIEW_BEFORE_CLOSE = false. ...
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. ... forum thread , collection operators and methods (IS EMPTY, SIZE, MEMBER OF, IN) are currently not supported for mapped by (inverse) ... // "SELECT a FROM A a WHERE a.list IS EMPTY"); //System.out.println(query.getResultList().size()); ...
OptimisticLockException
Have read read the documentation on optimistic locks, still not sure how to deal with these exceptions: [ObjectDB 2.2.5_04] javax.persistence.RollbackException Failed to commit transaction: Optimistic lock failed for object ... You can disable the L2 cache (or empty it with evict ) and empty the EntityManager (L1) cache by invoking clear . JDO provides some ...
javax.persistence.criteria.CriteriaBuilder
Used to construct criteria queries, compound selections, expressions, predicates, orderings.(Interface of JPA)
javax.persistence.metamodel.ManagedType
Instances of the type ManagedType represent entity, mapped superclass, and embeddable types.(Interface of JPA)
javax.persistence.metamodel.MappedSuperclassType
Instances of the type MappedSuperclassType represent mapped superclass types.(Interface of JPA)