ObjectDB ObjectDB

Internal Website Search

1-10 of 163 resultsRefresh

Mapped (Inverse) LAZY @OneToMany vs. Unmapped LAZY @OneToMany

to console a lazy @OneToMany mapped field after a finding entity manager closes. There is a switch DO_VIEW ... manager closes and as expected both a mapped @OneToMany list and an unmapped @OneToMany list are viewable ... = CascadeType.ALL)         A a; //maps: listA_mapped         @OneToMany(fetch = FetchType.LAZY, mappedBy


javax.persistence Annotation OneToMany Target: Fields (including property get methods) Defines ... of the relationship. The OneToMany annotation may be used within an embeddable class contained within an entity ... // In Customer class: @OneToMany(cascade=ALL, mappedBy="customer") public Set


Annotation Element javax.persistence.OneToMany Class targetEntity (Optional) The entity class that is the target of the association. Optional only if the collection property is defined using Java generics. Must be specified otherwise. Defaults to the parameterized type of the collection


Annotation Element javax.persistence.OneToMany 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.OneToMany String mappedBy The field that owns the relationship. Required unless the relationship is unidirectional. Default value: "" Since: JPA 1.0


Annotation Element javax.persistence.OneToMany 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 entities must be eagerly fetched. The LAZY strategy


Annotation Element javax.persistence.OneToMany CascadeType[] cascade (Optional) The operations that must be cascaded to the target of the association. Defaults to no operations being cascaded. When the target collection is a java.util.Map, the cascade element applies to the map value. Default value: {} Since: JPA 1.0

JPA Entity Fields

: OneToOne, ManyToOne - for references of entity types. OneToMany, ManyToMany - for collections and maps ... .ALL) MyEntity field2; @OneToMany(fetch=FetchType.EAGER) List<MyEntity> field3; } The entity ... ; } @Entity public class Department { @OneToMany(mappedBy="department") Set<Employee> employees

JPA Annotations for Relationships

Reference (JavaDoc) of JPA 2 relationship annotations, including @ManyToMany, @ManyToOne, @OneToMany, @OneToOne, @OrderBy and @MapKey.

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

Hello! When the JPA entities are not enhanced the removal of an entry from a @OneToMany collection ... .FetchType; import javax.persistence.OneToMany; import javax.persistence.Persistence; import org ... ;   } } @Entity public static class ParentEntity {   @OneToMany(fetch = FetchType.LAZY, cascade

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