About Id

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

 
forum_thread

Composite indexes

Hi, I read your manual about defining Indexes for JPA Entities (http://www.objectdb.com/java/jpa/entity/index), but I still have some problems understanding how and when should I use them.   Let's start with some example then. Assume we have an entity that represents an interior design image, called Inspiration : ... public class Inspiration { @ Id Long id ;   String room ; // type of the room (kitchen, bedroom etc.) ...

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

 
forum_thread

Handling "is null" in where clause

Greetings, I was playing aroung with JPQL and have found that there is a problem with "is null" queries. When you use "is null" in where clause, query runs correctly, but results are incorrect. Let me show you an example: - entity @Entity public class EntityA { @Id Integer id; Integer simpleField; (getters and setters here) - populating database... public class EntityA { @ Id Integer id ; Integer simpleField ;   // (getters and setters here) ...

 
issue

Eager Fetch of Map with Entities as Keys

Loading eagerly a map that uses entity objects as keys is currently unsupported, if the equals and hashCode method of the keys are based on the key entity content, since it is unavailable during instantiation of the map. The following test case demonstrates the problem: ... static class MyEntity { @ Id private long id = 1 ; @ OneToMany ( fetch = ...

 
api-jpa

javax.persistence.Transient

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

 
api-jpa

javax.persistence.MappedSuperclass

Designates a class whose mapping information is applied to the entities that inherit from it.(Annotation of JPA)

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