About Entity

forum_thread

Entity with java.util.Date column gives ClassCastException in BIRT

Copied a straightforward entity class from my coleague. Using Eclipse Kepler (Reporting) and stored it in ObjectDB 2.5.3_02. After creating an ObjectDB BIRT DataSource and a DataSet, entered a simple JPQL query to select the fields. Entity looks like this: ... Copied a straightforward entity class from my coleague. Using Eclipse Kepler (Reporting) and stored it ... DataSet, entered a simple JPQL query to select the fields. Entity looks like this: package entity ;   import ...

 
manual

Locking in JPA

Explains how to use optimistic locking and pessimistic locking in JPA.... ObjectDB maintains a version number for every entity object. The initial version of a new entity object (when it is stored in the database for the first time) is 1. In ...

 
forum_thread

Entity name

2. Object creation I created a class named EBResult which looks like this: @Entity(name="RESULT") public class EBResult extends Pojo implements Serializable{..... In ObjectDB-explorer (which is part of ObjectDB library) I expected to see an object named "RESULT" due to class annotation @Entity(name="RESULT"). Instead I see following: ... named EBResult which looks like this: @ Entity ( name = "RESULT" ) public class EBResult ... to see an object named "RESULT" due to class annotation @Entity(name="RESULT"). Instead I see following: 2.1. Why? Is ...

 
issue

Entity Version History

ObjectDB manages automatic entity versioning (for optimistic lock purposes). Every entity object modification is reflected by a new version number. Previous values in the entity object that are overridden by new values, however, are discarded. Some applications may benefit from the ability to go back in time and view old versions (and old values) of entity object. Future versions of ObjectDB should support archiving old versions of specific entity classes.... ObjectDB manages automatic entity versioning (for optimistic lock purposes). Every entity object modification is reflected by a new version number. Naturally, ...

 
api-jpa

contains(entity)

Check if the instance is a managed entity instance belonging to the current persistence context.(Method of javax.persistence.EntityManager)

 
forum_thread

Entity listener - event instead of object

Hi, Currently I'm playing with entity listener to implement auditing with difference between values in updated entity. There is a problem however with accessing "old" version of object stored in database. I can't find the nice way to use EntityManager in EntityListener. Because of that, I can't store separate entity for given event. Right now I'm using BaseEntity which contains ... Hi, Currently I'm playing with entity listener to implement auditing with difference between values in updated entity. There is a problem however with accessing "old" version of object ...

 
api-jpa

isLoaded(entity)

Determine the load state of an entity.(Method of javax.persistence.PersistenceUtil)

 
forum_thread

Merge on detached entities

Hello, it is possible to merge detached entities? There are some attached entities which load from the database. The transaction is finished and the entities become detached. In a new transaction the fields of the detached entities will be changed and a merge by em.merge(entity) will be saved the entities. Can this works correctly? How are the rules of the merge process? Do the changed fields of the detached entity overwrite the fields in the database? Also changed fields which are set to null? ... detached entities will be changed and a merge by em.merge(entity) will be saved the entities. Can this works correctly? ... the merge process? Do the changed fields of the detached entity overwrite the fields in the database? Also changed fields which are set ...

 
forum_thread

LAZY @ManyToOne field functions as EAGER

In the code example below (also attached) I would like to understand why I am able to print to console a lazy @ManyToOne field after the 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 LAZY @ManyToOne field and an EAGER @ManyToOne field are viewable: b.cLazy:{C}[2]"cLazy"
 b.cEager:{C}[3]"cEager" ... able to print to console a lazy @ManyToOne field after the entity manager closes. There is a switch DO_VIEW_BEFORE_CLOSE, and when it ... true the fields are accessed and output before the finding entity manager closes and as expected both a LAZY @ManyToOne field and an EAGER ...

 
issue

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

Environment: Mac OS X JVM: Java 1.8 u 20 Steps to reproduce Use the following classes: /** Account Class **/ ... /** Account Class **/ @ Entity @ JsonIdentityInfo ( generator = ... }     /** * Project Class */ @ Entity public class Project extends AbstractEntity implements ...