Home » Search

About OneToMany

111-120 of 148Refresh
Forum
1

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. No. There is no such configuration option, since having EAGER as the fetch type
Issue
1

Issue with cascade delete & add/remove

{         private String name = null;         @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true
Forum
1

Items in list are doubled, when the entity class is not enhanced

@GeneratedValue private Long id; @OneToMany(mappedBy = "customer",fetch= FetchType.EAGER
Forum
1

Iterating over large result set

are quite complicated and big with many @OneToMany relations, there was huge number of additional queries
Issue
1

JPQL support for mapped by (inverse) collections

class A {         @Id @GeneratedValue long id;                 @OneToMany(mappedBy
Forum
1

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
Forum
1

List always null

= GenerationType.AUTO)     private Long id;     @OneToMany(targetEntity = Noticia.class, mappedBy = "categorias
Forum
1

Maintaining referential integrity

an instance of Employee. I tried to use annotations like "OneToMany" and "ManyToOne", but the result
Forum
1

Merge of entity classes with "mapped by" very slow

Hi, I have found a strange behavior when merging entities with "mapped by" set on @OneToMany relation. Even if object is fetched with find on the same transaction, merge is very slow. It's because on merge every single relation marked as LAZY is fetch from database. Attached two examples
Forum
1

Multiple joins did not return expected result

Hello, I have 3 entity classes: Event - String title Calendar - List @OneToMany SharedCalendar extends Calendar - Calendar original Now I want to retrieve all events from a specific calendar by its id like: SELECT event FROM Calendar c1, SharedCalendar c2 INNER JOIN c1