About OneToOne

api-jpa

javax.persistence.OneToOne

Defines a single-valued association to another entity that has one-to-one multiplicity.(Annotation of JPA)

 
manual

JPA Entity Fields

Explains how to define and use primary keys in JPA, including composite and embedded primary keys.... with one of the following annotations: OneToOne javax.persistence.OneToOne JPA annotation Defines a single-valued association to ...

 
api-jpa

JPA Annotations for Relationships

Reference (JavaDoc) of JPA 2 relationship annotations, including @ManyToMany, @ManyToOne, @OneToMany, @OneToOne, @OrderBy and @MapKey.... javax.persistence.OneToMany javax.persistence.OneToOne Unlike ORM JPA implementations, ObjectDB does not ...

 
forum_thread

@OneToOne query issue with OR and IS NULL

Hello, I'm struggeling to get a query run right. I have 2 entities (simplified) ... private Long key ;   @ OneToOne ( mappedBy = "other" , cascade = ... private int counter ;   @ OneToOne private A other ; } so entity B is ...

 
forum_thread

significant performance decrease

we are using objected in embedded mode (on OS X and WINDOWS). The database increased now to around 400000 entities of one class (database file size around 1.5 GByte). The response time of standard queries increased with this database size to an unacceptable rate (several seconds compared to around 30% when the number of entities was just half of the current). We tried to optimize the cache settings, current objectdb.conf is: <!-- ObjectDB Configuration --> <objectdb> ... public String objectName ;   @ OneToOne public ObjectType objectType ;   @ Index ... ( ) ;   @ OneToOne ( fetch = FetchType . LAZY ) ...

 
issue

NullPointerException when using multithreading

[ObjectDB 2.4.4_08] Unexpected exception (Error 990)   Generated by Java HotSpot(TM) Client VM 1.6.0_29 (on Windows 7 6.1). Please report this error on http://www.objectdb.com/database/issue/new com.objectdb.o.InternalException: java.lang.NullPointerException: null java.lang.NullPointerException at com.objectdb.o.ENT.C(ENT.java:557) at com.objectdb.o.OBM.bz(OBM.java:385) at com.objectdb.o.OBM.bz(OBM.java:261) at com.objectdb.jpa.EMImpl.persist(EMImpl.java:377) at ... ... private String secondId ;   @ OneToOne ( cascade = CascadeType . ALL ) ... class EmbeddableA {   @ OneToOne ( cascade = CascadeType . ALL ) ...

 
forum_thread

EntityManager.refresh takes a long time

EntityManager.refresh takes a long time for entity object Person in this code: ... ( ) ;   @ OneToOne ( cascade = CascadeType . ALL ) ... ManyToOne private City city ; @ OneToOne ( cascade = { CascadeType . PERSIST ...

 
forum_thread

A bidirectional OneToOne association with a shared primary key

Hi, In Hibernate, it is possible (using Hibernate specific annotations) to define a bidirectional @OneToOne association that has a shared primary key, example: http://fruzenshtein.com/bidirectional-one-to-one-primary-key-association/ ... specific annotations) to define a bidirectional @OneToOne association that has a shared primary key, example: ... No annotations are required by ObjectDB (you may use @OneToOne annotations with no mappedBy ): @ Entity ...

 
forum_thread

Mapped By Fetch is very Slow

Well ! I think i pointed out a HUGE performance issue with mapped-by attribute (yeah again :( ). Here is the test case : 1- Create 100 000 entities with for each 1 entity with @OneToOne(mappedBy attribute) 2- Retrieve only 10 000 for testing 3- Wait ... On my AMD FX 8350, it took 60s Now, go the MyEntity class and remove "mapped-by". You obtain 1 second max of query fetch. ... 1- Create 100 000 entities with for each 1 entity with @OneToOne(mappedBy attribute) 2- Retrieve only 10 000 for testing ... . Id ; import javax. persistence . OneToOne ;   @ Entity public class MyEntity ...

 
forum_thread

Version 2.2.7 build 7/8 issue

Hi all, I have problems with builds 7 and 8 when trying to sort entities with mappedBy and my own method in query. This query "SELECT c FROM Customer c order by c.getNormalizedName()" returns List with null objects! With builds 6 and 5 works it correctly. Removing mappedBy from @OneToOne(mappedBy = "address") also helps. My code: ... builds 6 and 5 works it correctly. Removing mappedBy from @OneToOne(mappedBy = "address") also helps. My code: public ... private String name ;   @ OneToOne ( cascade = CascadeType . ALL , fetch = ...