ObjectDB ObjectDB

Internal Website Search

1-10 of 47 resultsRefresh
174

Persist error @ManyToMany how to define correct entities relationships

private long id; @ManyToMany(cascade=CascadeType.PERSIST) private List<Category> categories ... .EntityManagerFactory; import javax.persistence.Id; import javax.persistence.ManyToMany; import ... private long id; @ManyToMany(cascade=CascadeType.PERSIST) private List
147

Removing objects where ManyToMany relationships exist

Consider you have an entity Entity with the following unidirectional relationship: @ManyToMany private Set<OtherEntity> setOfOtherEntities; public Set<OtherEntity> getOtherEntities() { if (setOfOtherEntities == null) { setOfOtherEntities = new TreeSet<OtherEntity>(); } return setOfOtherEntities
101

javax.persistence.ManyToMany

javax.persistence Annotation ManyToMany Target: Fields (including property get methods) Defines ... side. If the relationship is bidirectional, the non-owning side must use the mappedBy element of the ManyToMany ... for the relationship, if not defaulted, is specified on the owning side. The ManyToMany annotation may be used
88

ManyToMany.fetch

Annotation Element javax.persistence.ManyToMany 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
88

ManyToMany.cascade

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

ManyToMany.targetEntity

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

ManyToMany.mappedBy

Annotation Element javax.persistence.ManyToMany String mappedBy The field that owns the relationship. Required unless the relationship is unidirectional. Default value: "" Since: JPA 1.0
27

Retrieving JPA Entity Objects

an explicit FetchType.EAGER setting: @Entity class Employee { : @ManyToMany(fetch ... in @OneToMany or @ManyToMany annotations (currently ObjectDB does not distinguish between
19

JPA Entity Fields

: OneToOne, ManyToOne - for references of entity types. OneToMany, ManyToMany - for collections and maps
11

javax.persistence.MapKeyJoinColumn

; ... @ManyToMany // students and courses are also many-many @JoinTable(name="ENROLLMENTS ... . If the join is for a map key for a ManyToMany entity relationship or for a OneToMany entity ... the collection table for the map value. If the join is for a map key for a ManyToMany entity relationship or

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