Internal Website Search

1-50 of 87 results

JPA Entity Fields

( mappedBy ="department") Set employees; } The mappedBy element (above) specifies that the employees ... .department = :d The mappedBy element defines a bidirectional relationship. In a bidirectional relationship ... annotation: @Entity public class Department { @OneToMany ( mappedBy ="department") @OrderBy ("name

LEFT (OUTER) JOIN problem when mappedBy is defined

invoices without items! Only invoices with items. When I remove mappedBy from @OneToMany annotation ... public class Invoice { @OneToMany( mappedBy = "invoice", fetch= FetchType.EAGER, orphanRemoval=true

mappedBy problem

If I put the mappedBy element to the @OneToMany, the owned side (the many side) will never persist ! for example @Entity public class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Long id; public String name; @OneToMany(targetEntity=Address.class, mappedBy ="employee

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.OneToMany.mappedBy

JPA Annotation Attribute in javax.persistence.OneToMany String mappedBy default "" The field that owns the relationship. Required unless the relationship is unidirectional. Since: JPA 1.0

javax.persistence.ManyToMany.mappedBy

JPA Annotation Attribute in javax.persistence.ManyToMany String mappedBy default "" The field that owns the relationship. Required unless the relationship is unidirectional. Since: JPA 1.0

EntityManager.refresh takes a long time

relationsto itself with a cascade refresh: @OneToMany( mappedBy = "person", cascade = CascadeType.ALL) private List openIdAuths = new ArrayList (); @OneToMany( mappedBy = "person", cascade = CascadeType ... private List selectedPersons = new ArrayList (); @ManyToMany( mappedBy = "selectedPersons", cascade

new objects not available in mappedBy associations

Given a mappedBy association: e.g: @OneToMany( mappedBy ="department") public List employees;   ... the department object" ? How does one refresh an object? If the mappedby tag maps to: SELECT e from EMPLOYEE e ... If the mappedby tag maps to: SELECT e from EMPLOYEE e WHERE e.department=department then shouldn't

Error 363 - Failed to read value of inverse relationship

{ @Id private String id; @OneToMany( mappedBy ="town") private Set events; public Set getEvents() { Set ... (), blockedUserList = new ArrayList (); @ManyToMany( mappedBy = "friendWishList") private List possibleFriends; @ManyToMany( mappedBy = "blockedUserList") private List invisibleUsers; @ManyToOne private

javax.persistence.ManyToMany

side. If the relationship is bidirectional, the non-owning side must use the mappedBy element of the ManyToMany ... is the owner of the relationship, the non-owning side must use the mappedBy element of the ManyToMany ... (".") notation syntax must be used in the mappedBy element to indicate the relationship attribute

Left join fetch behaviour doesn't retrieve children?

with mappedBy to the parent. This just break the test !  Test by yourself by adding / removing the mappedBy on the OneToOne annotation. Note that i don't create any entity on that attribute. The test ... = MyEntityChild2.class)   @OneToOne(targetEntity = MyEntityChild2.class, mappedBy = "myEntity

javax.persistence.OneToOne

the mappedBy element of the OneToOne annotation to specify the relationship field or property ... side must use the mappedBy element of the OneToOne annotation to specify the relationship field or property of the embeddable class. The dot (".") notation syntax must be used in the mappedBy element

javax.persistence.OneToMany

; otherwise the target entity class must be specified. If the relationship is bidirectional, the mappedBy element ... , the mappedBy element must be used to specify the relationship field or property of the entity ... Customer class: @OneToMany(cascade=ALL, mappedBy ="customer") public Set getOrders() { return orders

Optimistic locking: prevent version increment on entity collection attribute

seem to have some issues. I have changed my classes to have a OneTomany mappedBy relationship as follows ... ;  @Id private long id;        @OneToMany( mappedBy ="document")    ... static long ID_SEQ = 0; @Id private long id = ID_SEQ++; @OneToMany( mappedBy ="document") private

Why are my Map entries not stored?

, cascade=CascadeType.ALL, mappedBy = "ticket",     orphanRemoval=true ... (EnumType.STRING) private Map states = new HashMap (); Is this correct now? " mappedBy " is not required ... @ MappedBy : In that case the map content will be stored embedded in the Ticket instances and no 

javax.persistence.ManyToOne

side must used the mappedBy element to specify the relationship field or property of the entity ... is bidirectional, the non-owning OneToMany entity side must use the mappedBy element of the OneToMany ... side of the relationship. The dot (".") notation syntax must be used in the mappedBy element

Bidirectional OneToMany is slow on updated items

: @OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.LAZY/*, mappedBy = "person"*/) private Set ... Thanks for the reply. This looks great.   But without the mappedby , there are to independent ... ? Is there a way, not to change the code. Instead set a property to force objectdb to handle all mappedby as

Detaching objects after JOIN FETCH

? support Support While building test case I get two different cases: 1. When not using mappedBy , like in example above, detached objects are visible even after closing em. 2. When using mappedBy in class B (this is the case in my code), detached objects from relation are not visible. I should add mappedBy

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 ... with null objects! With builds 6 and 5 works it correctly. Removing mappedBy from @OneToOne( mappedBy ... ; @OneToOne( mappedBy = "address") private Customer customer; public Customer getCustomer() { return

javax.jdo.annotations.Persistent.mappedBy

JDO Annotation Attribute in javax.jdo.annotations.Persistent String mappedBy default "" Name of the related member in the other class where this value is mapped (bidirectional relationship). Since: JDO 2.1

javax.jdo.annotations.Order.mappedBy

JDO Annotation Attribute in javax.jdo.annotations.Order String mappedBy default "" Name of a field or property in the target class that acts as the ordering field or property for this member. Return the name of the field or property in the target class Since: JDO 2.1

javax.jdo.annotations.Key.mappedBy

JDO Annotation Attribute in javax.jdo.annotations.Key String mappedBy default "" Name of a member in the value class where this key is stored. Since: JDO 2.1

javax.jdo.annotations.Value.mappedBy

JDO Annotation Attribute in javax.jdo.annotations.Value String mappedBy default "" Name of a member in the key class where this value is stored. Since: JDO 2.1

javax.jdo.annotations.Element.mappedBy

JDO Annotation Attribute in javax.jdo.annotations.Element String mappedBy default "" Name of the member in the target class that forms a bidirectional relationship with this member. Since: JDO 2.1

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 ... = null;   @OneToOne(targetEntity = MyEntityChild.class, cascade = CascadeType.ALL, mappedBy = "myEntity") // Test by adding / remove " mappedBy " public MyEntityChild getEntityChild() {  

Error: Failed to write value of field X using reflection (oneToMany relation)

Persona{ @OneToMany( mappedBy ="Pedido.cliente") public List pedidos; } The class Persona ... You have to change the value of the mappedBy attribute: @OneToMany( mappedBy ="cliente") i.e. specify the field

javax.persistence.MapKey

. Example 1: @Entity public class Department { ... @OneToMany( mappedBy ="department") @MapKey // map key ... () { ... } ... } Example 2: @Entity public class Department { ... @OneToMany( mappedBy ="department") @MapKey

joining of tables

( mappedBy = "address") public Set getEmployee() { return employee; } how can i solve this problem ... if it is bidirectional relationships also add a reference back from Address to Employee with a mappedBy setting

Problem persisting a TreeSet field

relationship: @ManyToOne private Message parent; @OneToMany( mappedBy = "parent") private TreeSet children ... an ordinary persistent field instead of as an inverse field - remove he mappedBy setting, and update

Missing (null) elements in eager loaded references

extends BaseCostElement { @OneToMany ( mappedBy = "parent" , fetch = FetchType. EAGER ) private List ... extends BaseCostElement { @OneToMany ( mappedBy = "parent" , fetch = FetchType. EAGER ) private List

OneToMany and cascade delete problem

): @Entity public static class Store { @OneToMany(targetEntity = Offer.class, mappedBy = "store ... = Offer.class, mappedBy = "product", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private Set offers

NoSuchFieldError: __odbTracker on NetBeans 7.3 + JBoss 7.1.1

serialVersionUID = 1L; @ManyToOne @Index private City city; @OneToMany( mappedBy = "owner") private List ... serialVersionUID = 33L; @OneToMany( mappedBy = "city") private List persons; @ManyToOne @Index private Person

Object explorer cannot open odb file. ObjectDB many-to-many relationship

String code;     @OneToMany( mappedBy = "user") @MapKey     private Map ... code;         @OneToMany( mappedBy = "project") @MapKey   

A bidirectional OneToOne association with a shared primary key

relationship using "two unidirectional relationships" which (I assume) would not include a mappedBy ... annotations with no mappedBy ): @Entity public class Entity1 {     Entity2 e2

JPA vs JDO - which is more efficient for OneToMany queries?

this. Using JPA: @Entity class Customer { @OneToMany( mappedBy ="customer") Vector orders; }   ... other operations. support Support wow - just tried it, pretty impressive. I used JPA, and the @OneToMany( mappedBy

Removing an entity throws exception

( mappedBy = "customer", fetch= FetchType.LAZY) private List itemList; @OneToMany( mappedBy = "customer

Lazy loading does not work - crud takes long

; @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy ="project",fetch = FetchType.LAZY)   ... = CascadeType.ALL, orphanRemoval = true, mappedBy ="project",fetch = FetchType.LAZY)    

javax.persistence.OrderBy

{ ... @ManyToMany( mappedBy ="students") @OrderBy // ordering by primary key is assumed public List

javax.persistence.AssociationOverride

.class) List phoneNumbers; } @Entity public class PhoneNumber { @Id int number; @ManyToMany( mappedBy

Inverse OneToMany Mapping and EmbeddedId

; objectdb-2.9.0_03  *   *         issue: Inverse @OneToMany( mappedBy ... ;    @OneToMany ( mappedBy = "a" )          public List abs ... ( mappedBy = "b" )          public List abs ;      

Unexpected Exception during commit

(and other classes). Please notice that ObjectDB can manage collections directly with no mappedBy - and it is also much more efficient. Therefore, consider removing the mappedBy definition instead ... of entities that are not used as a collection, I assumed a mappedBy relationship would be better

NullPointer when accessing persistent field

as follows; @OneToMany(cascade=CascadeType.ALL, mappedBy ="z_component") @MapKey(name="z_schemeName ... static class A {         @OneToMany(targetEntity = B.class, mappedBy ... (cascade=CascadeType.ALL, mappedBy ="z_aqera") @MapKey(name="z_registerId")     private

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

, CascadeType.PERSIST}, mappedBy ="account", fetch = FetchType.LAZY) @JoinColumn(name = "project_id", unique=true ... ;     mappedBy ="account", fetch = FetchType.LAZY)      

com.objectdb.o.InternalException: null

extends PersistableObject {     @OneToOne( mappedBy = "spouse")     private ... = Payment.Periodicity.QUARTERLY;     @OneToMany( mappedBy = "customer", fetch

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

ArrayList (); @OneToMany( mappedBy = "owner", cascade = CascadeType.ALL) public List getOwnedElements ... is to set the fetch type to EAGER: @OneToMany( mappedBy = "owner", cascade = CascadeType.ALL, fetch=FetchType

javax.jdo.annotations.Value

) should be indexed. Since: JDO 2.1 String mappedBy default "" Name of a member in the key class

javax.jdo.annotations.Order

of the column(s) to use for ordering. Since: JDO 2.1 String mappedBy default "" Name of a field or

javax.jdo.annotations.Persistent

already loaded. Since: JDO 2.1 String mappedBy default "" Name of the related member in the other class

javax.jdo.annotations.Key

. Since: JDO 2.1 String mappedBy default "" Name of a member in the value class where this key is stored

javax.jdo.annotations.Element

"" Whether the value column(s) should be indexed. Since: JDO 2.1 String mappedBy default "" Name