About Entity

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 ...

 
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 {   @ ...

 
api-jpa

javax.persistence.MapKeyClass

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

 
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 { ...

 
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 ; ...

 
forum_thread

OrphanRemoval not working?

Dear all, I have entities Invoice and InvoiceItem, their relation is defined: public class Invoice implements Serializable { ..     @OneToMany(mappedBy = "invoice", fetch= FetchType.EAGER, orphanRemoval=true, cascade= CascadeType.ALL)     private List<InvoiceItem> invoiceItemList; .. } ... it from db, but using explorer, I can see, that the entity is still there with invoice field setted to null. When saving the entity, I'm using merge and flush. The entity object is managed, so I think ...

 
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 ...