About Entity

issue

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

Hello! When the JPA entities are not enhanced the remove of an entry from a @OneToMany collection is not possible. The following java code demonstrates the problem. The statement parentEntity.getChildEntityContainer().remove("01"); does not work with not enhanced JPA entities. ... . Column ; import javax. persistence . Entity ; import javax. persistence . EntityManager ; ... ( ) ; }     @ Entity public static class ChildEntity {   @ ...

 
issue

Weird issue with variable naming

hi, ... Embeddable ; import javax. persistence . Entity ; import javax. persistence . EntityManager ; ... 1000 ; ++ i ) { MyEntity entity = null ; if ( i % 2 == 0 ...

 
forum_thread

Database(*.odb) file size on disk

Hello, we have questions about the file size of ObjectDB database on disk. Can you tell us something about how the deleting of entities affects the size of *.odb files on disk? -Will the released memory always used by new entities? -Will be the database file automatically reduced?   We have created a small test, in which we create and delete entities. It looks like that the released memory are reused but the the file not resized. The database is at the end empty again, but larger than the initial size. ... CascadeType ; import javax. persistence . Entity ; import javax. persistence . EntityManager ; ... ) . begin ( ) ; EntityA entity = new EntityA ( ) ; entity . value ...

 
forum_thread

Field not persisted in abstract class with two level of nesting

Hi, I have a field (embedded TZ1) which is not persisted in class MHD1 (TZ1  extends AS and AS extends ATT). But it seems to work fine when I skip the AS and make TZ2 extend directly from ATT. Here is an example code MHD1 ... Serializable ; import javax. persistence . Entity ; import javax. persistence . EntityManager ; ... javax. persistence . Persistence ;   @ Entity public class MHD1 implements Serializable { ...

 
api-jpa

javax.persistence.MapKeyClass

Specifies the type of the map key for associations of type java.util.Map.(Annotation of JPA)

 
forum_thread

Should derived fields of an EmbeddedId be manually maintained by app code?

If I have an Entity which has a primary key which is derived and I am implementing it using @EmbeddedId, am I responsible for maintaining the derived fields of the @EmbeddedId? I could not find anything in the JPA 2.0 spec http://download.oracle.com/auth/otn-pub/jcp/persistence-2.0-fr-oth-JSpec/persistence-2_0-final-spec.pdf?e=1317047713&h=54831c176e81a244a4c309e13eba0b27 which tells me what to expect. ... 15:26 If I have an Entity which has a primary key which is derived and I am implementing it using ... . Basic ; import javax. persistence . Entity ; import javax. persistence . EntityManager ; ...

 
api-jpa

getIdentifier(entity)

Return the id of the entity.(Method of javax.persistence.PersistenceUnitUtil)

 
manual

Literals in JPQL and Criteria Queries

Describes literals in JPQL, including null, false, true, numbers, strings, dates enums and types.... ), enum literals (e.g. mypackage.MyEnum.MY_VALUE ) and entity type literals (e.g. Country ). JPQL literals should be used ... Time Literals Enum Literals Entity Type Literals Criteria Query Literals ...

 
api-jpa

javax.persistence.ManyToOne

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

 
forum_thread

Does ObjectDB support @Parent for @Embeddable reference to parent?

AFAIK JPA does not directly support an @Embeddable referencing the parent in which it is @Embedded. But Hibernate has a special @Parent for it (see Entity extensions 2.4.3.4.@Parent). @Entity public class Person { @Embeddable public Address address; ... } @Embeddable public class Address { @Parent public Person owner; ... } Is there a safe and recommended way of achieving this in ObjectDB ? ... But Hibernate has a special @Parent for it (see Entity extensions 2.4.3.4.@Parent ). @ Entity public class Person { @ Embeddable ...