About Id

forum_thread

Accessing objects to make them available after EntityManager close?!

Hi, I would like to get all the instances of an entity object. So I wrote a function which returns a list of these instances. My problem is if I print out these instances before closing the em and returning the list, it works as I expected; if not, the function returns only one field correctly, another field is always Null. The details is as follows: ... long serialVersionUID = 1L ;   @ Id @ GeneratedValue Long id ;   @ Unique private String word ; private ...

 
forum_thread

How to delete M2M relationship?

In user model class I have the following: public class User implements Serializable { ... User implements Serializable { @ Id @ GeneratedValue ( strategy = GenerationType . AUTO ) private Long id ;   @ ManyToMany ( mappedBy = ...

 
forum_thread

How to create a Unique constraint?

Hi, I'm trying to create a unique constraint. Here is a simple example: @Entity public class Account { @Id @GeneratedValue private long id; @Index(unique="true") private String name; } The code runs and my Account objects are persisted. But no exception is thrown if name is the same. What do I need to do to have a Unique constraint? Thanks, Carl   ... public class Account {   @ Id @ GeneratedValue private long id ;   @ Index ( unique = "true" ) ...

 
api-jpa

javax.persistence.Transient

Specifies that the property or field is not persistent.(Annotation of JPA)

 
forum_thread

Insertion Speed Rate and Batch Load

1. I got about 10K inserts / second, is it normal? I would expect more than that, like close to 100K/second. I can definitely do 80K inserts/seconds on Oracle with batch insert on table with one primary key. 2. Is batch update/insert operation supported? I attached the files. ... final class MyEntity { @ Id int id ; MyEntity ( int id ) { ...

 
api-jpa

javax.persistence.MapKeyColumn

Specifies the mapping for the key column of a map whose map key is a basic type.(Annotation of JPA)

 
forum_thread

Like fails if both underscore and percent are used

When using a like query that has both _ and % in it, ObjectDB seems to fail. Here is a unit test to demonstrate:   ... class StringHolder { @ Id public Long id ;   public String content ;   public ...

 
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 ? ... User implements Serializable { @ Id @ GeneratedValue ( strategy = ... . IDENTITY ) private Integer id ;   @ Access ( AccessType . PROPERTY ...

 
forum_thread

Error: Failed to write value of field X using reflection (oneToMany relation)

Hi there! I have been all day trying to solve this. I have read multiple sites and documentation, but I can go through this. I have a clase named Pedido, that have a reference ManyToOne to a clase Cliente. ... public class Pedido { @ Id @ GeneratedValue private long id ;   @ Embedded private Direccion origen ; ...

 
forum_thread

Removing an entity throws exception

Hi all, I'm testing ObjectDB for my project, but I have troubles with it. At this time I'm not able to remove customer entity, when it's read by a query (it's attached), it throws this exception: Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: com.objectdb.o._RollbackException: Failed to commit transaction: 51 ... ... long serialVersionUID = 1L ;   @ Id @ GeneratedValue private Long id ;   private String name ; private String surname ...