About Entity

api-jpa

javax.persistence.OrderBy

Specifies the ordering of the elements of a collection valued association or element collection at the point when the association or collection is retrieved.(Annotation of JPA)

 
forum_thread

Memory leak while merging parent with No Cascade annotation with children

Hello support, While tracking memory leak in my application i suspected a memory leak in the merging object db implementation. The test case is the following, just run and watch the "Memory Used" by comparing Cascade.ALL (or Cascade.MERGE ) to nothing. Tested with last version of Object Db ( 2.5.5_05 ) ... CascadeType ; import javax. persistence . Entity ; import javax. persistence . EntityManager ; ... ( ) ; }   @ Entity public static class MyEntity {   ...

 
forum_thread

EmbeddedId with Generated field value

@Entity public class A { @EmbeddedId private Id id; } @Embeddable public class Id { @Generated private long id; private String zone; } How can I get the field Id.id auto-incremented?   ... ********* Solution 1 ********* @ Entity @ IdClass ( CompositePK. class ) public ... ********* Solution 2 ********* @ Entity public class A {   @ EmbeddedId ...

 
forum_thread

Error 613 - i cant put a list<Athlete> into a Squad object

hey guys Im a swiss student and my english is not that good and ive never posted in your forum, so thats why im sorry if im doing any mistakes, but i have big trouble, because ive to get this straight till end of week. i uploaded also all classes but if u see the problem in the main problem field the classes are copied after the problem description. the structure: ... . List ;   import javax. persistence . Entity ; import javax. persistence . OneToMany ;   @ Entity public class Squad { private int ...

 
forum_thread

remove() and persist() in same transaction => Attempt to reuse an existing primary key value

Hello Support, in our configuration (FlushModeType.AUTO) is the execution of  em.find(Entity.class, <id>) much faster than an equivalent query. To optimize the Performance we define a special Entity (A) with additional data that use an existing ID of another Entity (B) from another class (another table). On this point we get no conflicts. If we remove additional data for Entity (B) and then the special Entity (A) is empty, we remove the special Entity (A). ... (FlushModeType.AUTO) is the execution of  em.find(Entity.class, <id>) much faster than an equivalent query. To optimize the Performance we define a special Entity (A) with additional data that use an existing ID of another Entity (B) ...

 
forum_thread

Exception after update of indices of Entity class

Hello, I changed the index definition of an entity class from @Index()... to @Indices() and now I get the following stacktrace upon start: ... Hello, I changed the index definition of an entity class from @Index()... to @Indices() and now I get the following ... ) public class Event extends Entity { @ Embedded private Recurrence ...

 
issue

JQL-Update Queries fails with activated L2-Cache

When using JQL-Update Queries it is basically not working without calling entityManager.clear() after a transaction commit. When the clear() method isn't called the entityManager will never return a container the updated Entities. Scenario 1: Disabled L2 Cache, updating elements using UPDATE-Query and fetching Entities afterwards from database. Expected result: Getting changed Entities from database - Actual result: No changes are visble. ... changed Entities from database - Actual result: Only one Entity has been updated, the rest has its old value. And here it is the same - ... not correct) result. Entity Container for Entities Main entry point of ...

 
forum_thread

Error 363 - Failed to read value of inverse relationship

I've got two objects: @Entity public class EEvent { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @ManyToOne(optional=false) private ETown town; public ETown getTown() { return town; } public void setTown(ETown town) { this.town = town; } } And: ... I've got two objects: @ Entity public class EEvent {   @ Id ... }   } And: @ Entity public class ETown { @ Id ...

 
forum_thread

OneToMany and cascade delete problem

Hi, I don't really know if this is a bug or maybe model that I make is bad. I have a problem with with two different classes with OneToMany relation to one, shared class. For example (first class): @Entity public static class Store { @OneToMany(targetEntity = Offer.class, mappedBy = "store") private List<Offer> offers; } second class: ... shared class. For example (first class): @ Entity public static class Store {   @ ... ; } second class: @ Entity public static class Product { @ ...

 
forum_thread

Bug: ClassCastException by retrieval

Hi, when a generic array put into ObjectDB, its type changed to Object[]! codes: ... Arrays ;   import javax. persistence . Entity ; import javax. persistence . EntityManager ; ... ) ; } }   @ Entity class Node<TN> {   @ Id @ ...