ObjectDB Database Search
1-50 of 54 resultsOneToMany and cascade delete problem with with two different classes with OneToMany relation to one, shared class. For example (first class): @Entity public static class Store { @ OneToMany (targetEntity = Offer.class, mappedBy = "store") private List offers; } second class: @Entity public static class Product { @ OneToMany (targetEntity | |
Memory use in OneToMany relationships Hello everyone, I have a question regarding the OneToMany / ManyToOne Relationship in ObjectDB. So imaging following setup: We have class A which holds an collection (List, Arrray ...) of class B. In a more usual DB like MySQL with a seperate server we first query for the Entitys of class | |
Bidirectional OneToMany is slow on updated items: @ OneToMany (cascade = {CascadeType.ALL}, fetch = FetchType.LAZY/*, mappedBy = "person"*/) private Set | |
JPA Entity Fields: @OneToOne , @ManyToOne : For references to entity types. @ OneToMany , @ManyToMany : For collections and maps ... . ALL ) MyEntity field2; @ OneToMany ( fetch = FetchType . EAGER ) List field3; } The preceding entity class ... { String name; @ManyToOne Department department; } @Entity public class Department { @ OneToMany | |
Unable to update a OneToMany SetUnable to update a OneToMany Set | |
jakarta.persistence.JoinColumn Customer class @ OneToMany @JoinColumn(name = "CUST_ID") // join column is in the table for Order public Set getOrders() { return orders; } See Also: ManyToOne OneToMany OneToOne JoinTable ... OneToMany mapping using a foreign key mapping strategy, the foreign key is in the table of the target | |
jakarta.persistence.MapKeyJoinColumn and the default values apply. Example 1: @Entity public class Company { @Id int id; ... @ OneToMany ... relationship or for a OneToMany entity relationship using a join table, the foreign key column is in a join table. If the join is for a OneToMany entity relationship using a foreign key mapping strategy | |
jakarta.persistence.MapKeyColumn. If the map key is for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the map key column is in a join table. If the map key is for a OneToMany entity relationship ... is for a OneToMany or ManyToMany entity relationship using a join table, the name of the join table | |
jakarta.persistence.MapKeyClass one of the collection-valued relationship annotations ( OneToMany or ManyToMany ). The MapKey annotation ... ; ... } Example 3: @Entity public class Company { @Id int id; ... @ OneToMany (targetEntity = com.example ... ; ... @ OneToMany Map organization; } See Also: ElementCollection OneToMany ManyToMany Since: Jakarta | |
jakarta.persistence.ManyToOne is bidirectional, the non-owning OneToMany entity side must use the mappedBy element to specify ... , the non-owning OneToMany entity side must use the mappedBy element of the OneToMany annotation ... pm; // Bidirectional } @Entity public class ProgramManager { @Id int id; @ OneToMany (mappedBy | |
jakarta.persistence.MapKeyEnumerated relationship of type Map , in conjunction with the ElementCollection , OneToMany , or ManyToMany annotation ... Employee { @ManyToMany public Projects getProjects() { ... } @ OneToMany @MapKeyEnumerated(STRING) public Map getEmployees() { ... } ... } See Also: ElementCollection OneToMany ManyToMany Since: Jakarta | |
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 ... javax.persistence. OneToMany ; import javax.persistence.Persistence; import org.junit.Assert; public ... { @ OneToMany (fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)   | |
jakarta.persistence.MapKey when MapKey is specified and vice versa. Example 1: @Entity public class Department { ... @ OneToMany ... { ... @ OneToMany (mappedBy = "department") @MapKey(name = "name") public Map getEmployees | |
jakarta.persistence.MapKeyTemporal with the ElementCollection , OneToMany , or ManyToMany annotation. Example: @ OneToMany @MapKeyTemporal(DATE | |
jakarta.persistence.Convert) Map responsibilities; Example 6: Apply a converter to a map key of basic type @ OneToMany @Convert ... to an embeddable that is a map key for a relationship @ OneToMany @Convert(attributeName = "key | |
persisting object with long[][] arrays of array.persistence. OneToMany ; @Entity public class TESTObject implements Serializable{   ... ; @ OneToMany (fetch = FetchType.EAGER, cascade = CascadeType.ALL) public long[] time; @ OneToMany (fetch = FetchType.EAGER, cascade = CascadeType.ALL) private long[][] a1;   | |
jakarta.persistence.JoinTable ManyToOne , OneToOne , ManyToMany , or OneToMany . See Also: JoinColumn JoinColumns Since: Jakarta | |
jakarta.persistence.FetchType ManyToMany OneToMany ManyToOne OneToOne Since: Jakarta Persistence (JPA) 1.0 Enum Constants EAGER Data | |
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 | |
Missing (null) elements in eager loaded references has a OneToMany relationship to DataElement. Every relationship is eagerly fetched Problem ... extends BaseCostElement { @ OneToMany (mappedBy = "parent" , fetch = FetchType. EAGER ) private List ... extends BaseCostElement { @ OneToMany (mappedBy = "parent" , fetch = FetchType. EAGER ) private List | |
Does ObjectDB support lazy loading? a Parent class which contains List , marked with @ OneToMany . After persisting a Parent object, (in ... to @ OneToMany (fetch=FetchType.EAGER), the properties can be read. It seems to me that ObjectDB doesn't ... A { @Id @GeneratedValue Long id; @ OneToMany (fetch=FetchType.LAZY, cascade=CascadeType.ALL) List list | |
Multiple Collection Fields not update correctly v2.8.8_2 I have an entity that has 2 collection fields: @ OneToMany (fetch = FetchType.EAGER) Collection position; @ OneToMany (fetch = FetchType.EAGER) Collection rotation ; Now if I persist them so the values are: position | |
problem with lazy loading - unittest project attached hi, i'm still testing objectdb together with spring-data-jpa. i made a test which should simulate 4 requests 1. save entity 2. read an existing entity, add onetomany relation 3. read an existing entity, add another onetomany relation 4. read entity, get relations. i have the feeling this is not | |
"Failed to serialize instance" of Set problem Hi, I'm trying to persists objects defined as follows: @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public abstract class AbstractContainer { ... @ OneToMany (fetch = FetchType.LAZY ... ObjectDB tries to serialize the collection using ordinary Java serialization ignoring the @ OneToMany | |
List of Enum Values in an entity LAZY to EAGER : private @ OneToMany (fetch=FetchType.EAGER) List flags; According ... that the @ OneToMany works here? Thank you Flashbaer Flashbaer Joachim Beig Eclipse is right. It shouldn't | |
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 | |
Is it possible to remove parent/child entities without refresh?.persistence. OneToMany ; import javax.persistence.Persistence; import org.junit.AfterClass; import org ... ; @ OneToMany (fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "parent | |
Merge with Parent/Child entities not possible.persistence.MapKey; import javax.persistence. OneToMany ; import javax.persistence.Persistence; import javax ... { @Id @GeneratedValue private long id; @ OneToMany (fetch = FetchType.LAZY | |
_PersistenceException: Type is not found on getSingleResult.; private Municipio lugarNacimiento; @ OneToMany (mappedBy | |
Is there a way to set EAGER fetch on all "ToMany" collection relationships Given that the default seems to be FetchType.LAZY for all collections @ OneToMany and @ManyToMany. Such as a configuration option. Instead of having to explicitly set fetch in annotation code in every relationship. webel Dr Darren Kelly No. There is no such configuration option, since having EAGER | |
Possible cause for "Enhancement of type ... is old and cannot be used": FAILS on @ OneToMany with @TableGenerator/strategy = GenerationType.TABLE (www.objectdb.com | |
LifeCycle Event with Embeddable classes Hello, is there a way that lifecycle events like prepersist or preupdate are also fired for embeddable classes, not just for entities? My case looks as follows: @Entity public class Foo { @Id @GeneratedValue private Long id; private String description; @ OneToMany (cascade = CascadeType.ALL, fetch | |
Double persist of Entity field with Cascade.ALL bookTitle; @ OneToMany (cascade= CascadeType.ALL, fetch= FetchType.EAGER) private List chapters; The Chapter | |
Performance and memory usage of queries javax.persistence.FlushModeType; import javax.persistence. OneToMany ; import javax.persistence | |
Problem persisting a TreeSet field Hello, I am getting a "java.lang.IllegalArgumentException: Can not set java.util.TreeSet field Message.children to java.util.HashSet" when persisting a Message object with a parent/children relationship: @ManyToOne private Message parent; @ OneToMany (mappedBy = "parent") private TreeSet children | |
find() cost unreasonable time!) private int id; @ManyToOne @JoinColumn(name="parent") protected Nodes parent; @ OneToMany (mappedBy | |
Using of Second Level Cache myEntity2; @ OneToMany private List list; } btc_es BTC | |
Query over the keySet of a map field with collection parameter; } @ OneToMany (cascade = CascadeType.ALL) public Map map = new HashMap (); } @Entity public static class | |
TemporalType injection with Calendar using JPA(TimePeriod id) { this.id = id; } @ OneToMany (cascade=javax.persistence.CascadeType.ALL,fetch=javax | |
Storing objects problem adding an annotation to a reference: @ OneToMany (cascade=CascadeType.PERSIST)   | |
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 | |
OrphanRemoval not working? Dear all, I have entities Invoice and InvoiceItem, their relation is defined: public class Invoice implements Serializable { ... @ OneToMany (mappedBy="invoice", fetch=FetchType.EAGER, orphanRemoval=true, cascade=CascadeType | |
New to Product & Having An Issue() { return name; } public void setName(String name) { this.name = name; } @ OneToMany (fetch=FetchType | |
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 ... .RemoteTestRunner.main(RemoteTestRunner.java:197) As before a Map structure was being accessed. @ OneToMany | |
spuriously objectdb objects have null references definitions are (for the null references above): ... @ OneToMany (fetch=FetchType.LAZY) @Index public List actions = new ArrayList (); ... @ OneToMany (fetch=FetchType.LAZY) @Index public List childNodes | |
After using the enhancer, Lazy loaded collections are no longer loading. They are set as null; } @Override public void setId(Long id) { this.id = id; } @ OneToMany (cascade={CascadeType.MERGE ... ; @ OneToMany (cascade={CascadeType.MERGE, CascadeType.PERSIST},   | |
ArrayIndexOutOfBoundsException on flush to in the first exception is stored in a HashMap object within the parent entity: @ OneToMany | |
new objects not available in mappedBy associations Given a mappedBy association: e.g: @ OneToMany (mappedBy="department") public List employees; creating a new mapped class, e.g. new Employee, won't result in this object being available in the same transaction: ie: for (Employee e : department.employee) won't include the new object | |
Eager Fetch of Map with Entities as Keys id = 1; @ OneToMany (fetch=FetchType.EAGER)   | |
[ObjectDB 2.2.5_02] Unexpected exception (Error 990) com.objectdb.o.InternalException: java.lang.NullPointerException: null; } @ OneToMany (cascade=javax.persistence.CascadeType.ALL,fetch=javax.persistence.FetchType.EAGER |