About Id


Object comparation never matches

Hi! I'm trying to compare 2 identical objects in SELECT with no success: @Embeddable public class PhoneNumber implements Serializable {     int countryCode;     long number;   Which is a part of Customer object: ... extends Customer { @ Id @ GeneratedValue private Long id ; public void setPrincipal ( PhoneNumber number ) ...


LifeCycle Event with Embeddable classes

Hello, is there a way that lifecycle events like prepersist or preupdate are also fired for embeddable classes, not just for entities? My case looks as follows: ... public class Foo {   @ Id @ GeneratedValue private Long id ;   private String description ;   @ OneToMany ...


java.sql.Timestamp.getTime() not working

Hi, I need to work with Timestamp diff in two entity fields, but this queries SELECT count(p) FROM Player p WHERE p.loginAt.getTime()-p.registeredAt.getTime()>:value SELECT p.loginAt.getTime() FROM Player p fails with object is not an instance of declaring class but SELECT p.loginAt.getYear() FROM Player p works. How that possible?   ... Entity public class Player { @ Id @ GeneratedValue ( strategy = ... . IDENTITY ) public int id ; @ Temporal ( TemporalType . TIMESTAMP ) ...


Lazy loading does not work - crud takes long

tomee7.0.0SNAPSHOT,objectdb 2.6.4 The OneToMany Entities are filled with 40.000 Records and they have between 20-40 Columns. It takes over 50s to load all Project Enities that contains the OneToMany Relationships. It should be load lazy but i didnt know why the query fetch all the Data. ... implements Serializable {   @ Id @ GeneratedValue ( strategy = ... = "PROJECT_SEQUENCE" ) private Long id ; .. .. @ OneToMany ( cascade = ...



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


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


NullPointerException while setting a new property value

Hello, we are using ObjectDB version 2.4.4 and we are unable to resolve following NPE on enhanced entity: java.lang.NullPointerException at com.objectdb.o.ENT.beforeModifyMember(ENT.java:1099) at model.PluginMetaData.__odbSet_maxAllowedDownloads(PluginMetaData.java:1) at model.PluginMetaData.setMaxAllowedDownloads(PluginMetaData.java:268) at model.PluginMetaData.setPluginDescriptor(PluginMetaData.java:94) PluginMetaData looks like this (nothing extraordinary, no relationship to other @entities): ... class PluginMetaData {   @ Id @ GeneratedValue private Long dbId ;   //persisted info private String id ; private boolean updatesEnabled ; private ...


Unexpected exception (Error 990) - Merge with no Transaction

I am frequently having an error when merging a detached object outside of a transaction. (Is this allowed? I am not trying to modify the object, just read data from it.) Here is a test case: ... static class A { @ Id @ GeneratedValue Long id ;   String value ;   A ( String ...


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


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