ObjectDB ObjectDB

Internal Website Search

1-10 of 69 resultsRefresh

@OneToOne query issue with OR and IS NULL

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


javax.persistence Annotation OneToOne Target: Fields (including property get methods) When using ... . If the relationship is bidirectional, the non-owning side must use the mappedBy element of the OneToOne annotation to specify the relationship field or property of the owning side. The OneToOne annotation


Annotation Element javax.persistence.OneToOne Class targetEntity (Optional) The entity class that is the target of the association. Defaults to the type of the field or property that stores the association. Default value: void.class Since: JPA 1.0


Annotation Element javax.persistence.OneToOne boolean orphanRemoval (Optional) Whether to apply the remove operation to entities that have been removed from the relationship and to cascade the remove operation to those entities. Default value: false Since: JPA 2.0


Annotation Element javax.persistence.OneToOne FetchType fetch (Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity must be eagerly fetched. The LAZY strategy


Annotation Element javax.persistence.OneToOne CascadeType[] cascade (Optional) The operations that must be cascaded to the target of the association. By default no operations are cascaded. Default value: {} Since: JPA 1.0


Annotation Element javax.persistence.OneToOne boolean optional (Optional) Whether the association is optional. If set to false then a non-null relationship must always exist. Default value: true Since: JPA 1.0


Annotation Element javax.persistence.OneToOne String mappedBy (Optional) The field that owns the relationship. This element is only specified on the inverse (non-owning) side of the association. Default value: "" Since: JPA 1.0

JPA Entity Fields

: OneToOne, ManyToOne - for references of entity types. OneToMany, ManyToMany - for collections and maps ... EntityWithFieldSettings { @Basic(optional=false) Integer field1; @OneToOne(cascade=CascadeType ... Employee { @OneToOne MedicalInsurance medicalInsurance; } @Entity public class MedicalInsurance

Deleting JPA Entity Objects

can be referenced by a collection field): @Entity class Employee { : @OneToOne(cascade ... cascading mode which can be specified using the orphanRemoval element of the @OneToOne and @OneToMany annotations: @Entity class Employee { : @OneToOne(orphanRemoval=true) private

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support