Internal Website Search

1-50 of 68 results

JPA Entity Fields

). Every persistent field can be marked with one of the following annotations: OneToOne , ManyToOne ... { @Basic ( optional =false) Integer field1; @ OneToOne ( cascade = CascadeType . ALL ) MyEntity field2 ... { @ OneToOne MedicalInsurance medicalInsurance; } @Entity public class MedicalInsurance { @ OneToOne

javax.persistence.OneToOne

JPA Annotation OneToOne Target: METHOD, FIELD Implemented Interfaces: Annotation Specifies ... the mappedBy element of the OneToOne annotation to specify the relationship field or property of the owning side. The OneToOne annotation may be used within an embeddable class to specify

Deleting JPA Entity Objects

can be referenced by a collection field): @Entity class Employee { : @ OneToOne ( cascade ... which can be specified using the orphanRemoval element of the @ OneToOne and @OneToMany annotations: @Entity class Employee { : @ OneToOne ( orphanRemoval =true) private Address address; : } When an Employee

@OneToOne query issue with OR and IS NULL

;          @ OneToOne (mappedBy = "other", cascade ... ;  private int counter;     @ OneToOne     private

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 ... attribute ? Thanks andrewv Andrew Voumard No annotations are required by ObjectDB (you may use @ OneToOne

javax.persistence.OneToOne.cascade

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

javax.persistence.OneToOne.targetEntity

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

javax.persistence.OneToOne.mappedBy

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

javax.persistence.OneToOne.orphanRemoval

JPA Annotation Attribute in javax.persistence. OneToOne boolean orphanRemoval default false (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. Since: JPA 2.0

javax.persistence.OneToOne.optional

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

javax.persistence.OneToOne.fetch

JPA Annotation Attribute in javax.persistence. OneToOne FetchType fetch default EAGER (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

Detached Entity Objects

field): @Entity class Employee { : @ OneToOne ( cascade = CascadeType . DETACH ) private Address address ... can be referenced by a collection field): @Entity class Employee { : @ OneToOne ( cascade = CascadeType . MERGE

Retrieving JPA Entity Objects

FetchType . LAZY in either @ OneToOne or @ManyToOne annotations (currently ObjectDB does not distinguish ... can be referenced by a collection field): @Entity class Employee { : @ OneToOne ( cascade = CascadeType

Storing JPA Entity Objects

{ : @ OneToOne ( cascade = CascadeType . PERSIST ) private Address address; : } In the example

significant performance decrease

public String objectName; @ OneToOne public ObjectType objectType; @Index public Integer state; public Map ... = new ArrayList (); @ OneToOne (fetch=FetchType.LAZY) public ObjectNode currentLocation; @ OneToOne ... ArrayList (); @ OneToOne (fetch=FetchType.LAZY) public ObjectNode linkedType; @OneToMany(fetch

Left join fetch behaviour doesn't retrieve children?

the mappedBy on the OneToOne annotation. Note that i don't create any entity on that attribute. The test ... ; MyEntity(String name) {    this.name = name;   }   // @ OneToOne (targetEntity = MyEntityChild2.class)   @ OneToOne (targetEntity = MyEntityChild2.class, mappedBy = "myEntity

javax.persistence.JoinColumn

;} See Also: ManyToOne OneToMany OneToOne JoinTable CollectionTable ForeignKey Since: JPA 1.0 Public Annotation ... . The table in which it is found depends upon the context. If the join is for a OneToOne or ManyToOne ... mapping or for a OneToOne or bidirectional ManyToOne/OneToMany mapping using a join table, the foreign

javax.persistence.PrimaryKeyJoinColumn

to a primary table; and it may be used in a OneToOne mapping in which the primary key of the referencing ... { ... } See Also: SecondaryTable Inheritance OneToOne ForeignKey Since: JPA 1.0 Public Annotation Attributes String ... for the column. This should not be specified for a OneToOne primary key association. Defaults to the generated

Performance issue in a query due to compareTo calls

) @ElementCollection private Map values = new HashMap (); @ OneToOne (fetch = FetchType.LAZY, cascade ... ; @ OneToOne (fetch = FetchType.EAGER) private TCStep step; //For performance reasons, we use a list ... (AccessType.FIELD) public class Values extends Identifiable { @ OneToOne (fetch = FetchType.EAGER) private

EntityManager.refresh takes a long time

.REFRESH) private List comments = new ArrayList (); @ OneToOne (cascade = CascadeType.ALL) private SiteAuth ... ; @ OneToOne (cascade = {CascadeType.PERSIST}) private Image mainImage; @ OneToOne (cascade = {CascadeType

Mapped By Fetch is very Slow

again :( ). Here is the test case : 1- Create 100 000 entities with for each 1 entity with @ OneToOne (mappedBy ... .persistence.Id; import javax.persistence. OneToOne ; @Entity public class MyEntity { @Id private String name ... = null;   @ OneToOne (targetEntity = MyEntityChild.class, cascade = CascadeType.ALL,mappedBy

@OneToMany(fetch = FetchType.LAZY) list is always null

the entity containing another one ( OneToOne ) entity with a byte[] array without calling the getter ... Parent { // ...id @ OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL) private ByteData bydaData ... = GenerationType.AUTO) private int id; @ OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL) private OTO

Version 2.2.7 build 7/8 issue

with null objects! With builds 6 and 5 works it correctly. Removing mappedBy from @ OneToOne (mappedBy ... ; @Basic(optional=false) private String name; @ OneToOne (cascade= CascadeType.ALL, fetch= FetchType.EAGER ... ; @ OneToOne (mappedBy = "address") private Customer customer; public Customer getCustomer() { return

javax.persistence.JoinColumn.table

to be in the primary table of the applicable entity. Default: If the join is for a OneToOne or ManyToOne ... , the name of the table of the target entity. If the join is for a ManyToMany mapping or for a OneToOne or

javax.persistence.JoinColumn.name

is for a OneToOne or ManyToOne mapping using a foreign key mapping strategy, the foreign key column ... . If the join is for a ManyToMany mapping or for a OneToOne or bidirectional ManyToOne/OneToMany mapping

Multiple Collection Fields not update correctly

to another entity and they both reciprocally do: EntityB:     @ OneToOne (cascade = CascadeType.ALL)     EntityA entityA;   EntityA:     @ OneToOne (cascade

Multi threading on DMOs by lazy loading

It is possible to use lazy loading on fields of attached entities by several threads? Example: class EntityZ { @ OneToOne (fetch = FetchType.LAZY) EntityX fieldX; @ OneToOne (fetch = FetchType.LAZY) EntityY fieldY; @ElementCollection (fetch = FetchType.LAZY) List list; } We want to load the entity

General Performance Issues Illustrated with a Specific Method

; import javax.persistence.ManyToOne; import javax.persistence. OneToOne ; import javax.persistence.Table ... = GenerationType.AUTO) private Long id; private static final long serialVersionUID = 1L; @Index @ OneToOne

Composite indexes

? #4. Are @Index field used also on relations? @ OneToOne , @ManyToOne? I don't want to start ... with and without such an index. 4. Are @Index field used also on relations? @ OneToOne , @ManyToOne

Problem with @Basic(fetch = FetchType.LAZY)

with @ OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL)     private LargeString description;     @ OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL)   

Extra uninitialised entities spawned on merge()

@ OneToOne Element child . package test; import java.util.*; import javax.persistence.*; public class ... ;   private Element child;         @ OneToOne  

Pre-detach loading: retrieval by navigation not working in if statement

" Boolean value wrapper BooleanValue entity. This is @ OneToOne with explicit LAZY fetch. - A BooleanValue ... ' which is a "deep" Float value wrapper FloatQuantity entity. This is @ OneToOne with explicit LAZY fetch

Upgrade to 2.4.1_01

our code for 2.3.7_18, we had @ OneToOne (cascade=CascadeType.ALL, fetch=FetchType.EAGER ... more @ OneToOne gives: [ObjectDB 2.4.1_01] javax.persistence.PersistenceException Failed to clear field

Mysterious "Attempt to persist a reference to a non managed instance" error

.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence. OneToOne ; import static ... ;  @ OneToOne (fetch=EAGER, cascade=PERSIST) public Ostrich ostrich;     @ManyToMany

javax.persistence.AssociationOverrides

protected Address address; @ OneToOne protected Locker locker; public Integer getId() { ... } public

javax.persistence.PrimaryKeyJoinColumn.referencedColumnName

the same name as the primary key column for the table for the referencing entity ( OneToOne mapping). Since: JPA 1.0

javax.persistence.PrimaryKeyJoinColumn.columnDefinition

JPA Annotation Attribute in javax.persistence.PrimaryKeyJoinColumn String columnDefinition default "" (Optional) The SQL fragment that is used when generating the DDL for the column. This should not be specified for a OneToOne primary key association. Defaults to the generated SQL to create a column of the inferred type. Since: JPA 1.0

javax.persistence.FetchType

ManyToMany OneToMany ManyToOne OneToOne Since: JPA 1.0 Enum Constants EAGER Defines that data

javax.persistence.MapsId

JPA Annotation MapsId Target: METHOD, FIELD Implemented Interfaces: Annotation Designates a ManyToOne or OneToOne relationship attribute that provides the mapping for an EmbeddedId primary key, an attribute within an EmbeddedId primary key, or a simple primary key of the parent entity. The value

javax.persistence.PrimaryKeyJoinColumn.name

key column for the table for the referencing entity ( OneToOne mapping). Since: JPA 1.0

Using of Second Level Cache

MyEntity1 {        @ OneToOne     private MyEntity2

Are indexes implicitly created for relationships?

Do the following annotations @OneToMany @ManyToOne @ManyToMany @ OneToOne imply @Index   ? Thanks, Carl   FastModel Ben Schreiber Actually these annotations (except @ManyToMany ) should apply @Unique on the @One side. But ObjectDB doesn't apply these indexes automatically

Database(*.odb) file size on disk

; import javax.persistence.Id; import javax.persistence. OneToOne ; import javax.persistence.Persistence

"Unexpected query expression" using CriteriaQuery FetchParent Interface

.class);   root.fetch("PersonData"); //@ OneToOne relationship   criteriaQuery.select(root

ArrayIndexOutOfBoundException

{ @ OneToOne (fetch = FetchType.EAGER) private CacheableJobInfo ji; @ OneToOne (fetch = FetchType.EAGER) private ... . The problem dissapeared when removing the @ OneToOne (fetch = FetchType.EAGER) annotation. I am not

NullPointerException when using multithreading

private String secondId; @ OneToOne (cascade=CascadeType.ALL) private HashMap myMap; } @Embeddable public class EmbeddableA { @ OneToOne (cascade=CascadeType.ALL) private HashMap myMap; } @Embeddable public class EmbeddableB { @ OneToOne (cascade=CascadeType.ALL) private HashMap myMap; } I'm am trying

ClassCastException after upgrade to 2.3.5_03

follows: @Entity public class ObjectDbMessagePayload { @Id String id; @ OneToOne (orphanRemoval=true, cascade=CascadeType.ALL, fetch=FetchType.EAGER) private Object payload; @ OneToOne (orphanRemoval=true

Tracking changes to new collections (in enhancement mode) after flush

= "uid") private String uid; @ OneToOne (fetch = FetchType.EAGER, cascade = {CascadeType.REFRESH ... uid; @ OneToOne (fetch = FetchType.EAGER, cascade = {CascadeType.REFRESH, CascadeType.DETACH }) private

Once served to JSF page via @EJB query bean, many list fields are null (but same query ok after fresh persist in @PostConstruct)

simple @ OneToOne relationship fields that likewise become null: private List ownedElements = new ... my larger real-world application, lots of other @OneToMany and @ OneToOne fields are also null). In

New entity objects are duplicated on merge cascading

;    @ OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL)     ... ;  @ OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL)