Questions tagged [eager]

eager database fetching: efficiently load related objects along with the objects being queried.

(contrast with lazy fetching or lazy loading)

Related tags

134 questions
1
vote
0 answers

How to force an embedded Grizzly web application context to start

I use an embedded Grizzly web server to host RESTful web-services with Jersey. This is all working correctly. My question is how to force the web application context to eagerly initialise when I start the server rather than waiting for the first…
caprica
  • 3,902
  • 4
  • 19
  • 39
1
vote
0 answers

JPA2 : N+1 select even with a query with JOIN

In my application, I have an entity A with a list of entities B that should be fetched eagerly : @Entity public class A { ... /* @OrderBy("cValue.id ASC") */ @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) …
1
vote
2 answers

NHibernate - why is this collection not initialized / eager fetched?

Considering this: var pfs = Session.QueryOver() .JoinAlias(pf => pf.Responses, () => responseAlias) .List(); followed by this Debug.Print(pfs.First().Responses.Count.ToString()); Why would that debug…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
1
vote
1 answer

Laravel Eager Loading missing relationships when chained with first()/all()

Using L3 the following works fine : $r = Site::with('services')->get() That returns exactly what I'd expect. An array of Site objects, with the services relationship all neatly populated. However, if instead I only use the following: $r =…
1
vote
1 answer

Hibernate: Eager fetching / help me survive my hibernate nightmare

I am trying to return a List of Objects with the following HQL-Statement: return getHibernateTemplate().findByNamedParam("Select distinct response.user from Survey survey inner join fetch survey.surveyDates surveyDate inner join fetch…
superHH
  • 239
  • 3
  • 9
1
vote
0 answers

Trying to understand Hibernate Fetch Eager Strategy

I have currently significant performance problems with a proliferation if SQL-Statements executed by hibernate (V3.5.1) during a request. So I tried to dive into the details to understand the details of eager-fetching. Basically the problem seems to…
0
votes
0 answers

Hibernate how to fetch EAGER @OneToMany with criteria query?

I'm new to Hibernate and I have some problems with my code, I have problem with EAGER fetch with my 4 pojo classes: - Post POJO: @Data @Table(name = "post") public class Post implements Serializable { @OneToMany(fetch =…
Pla
  • 1
  • 1
  • 1
0
votes
1 answer

Eager loading of multiple related entities

I need to add an extension method that can handle multiple Include to an already existing Repository class: public abstract class Repository : IRepository where TEntity : class { private MyContext…
jdalino
  • 1
  • 2
0
votes
0 answers

Doctrine postLoad only affecting main entity and not associations

I've got a Listener that decrypts certain fields at postLoad event. It's working great except for the issue that the related entities to the main one don't work. I tried to edit my entities so the associations have the fetch="EAGER" but that only…
0
votes
0 answers

How to use eager relation to be in mandatory where with orWhere

Hi I have a filter dropdown where subjects are listed as well as a search input, now what do I want is that every time a user will search anything he needs to first choose the subject which is mandatory and if he wants to type something in search,…
Baby Babai
  • 197
  • 1
  • 10
0
votes
1 answer

How to create pagination in eager loaded relationship in laravel

I want the pagination to happen in eager loaded relation but when I am using it I am getting an error. Method Illuminate\Database\Eloquent\Collection::links does not exist. This only happens when I use {{ $SubjectReport->reports->links() }} in views…
0
votes
1 answer

Nested one-to-many relationship Laravel filtering to one record

I have a product model, inventory model, and user_inventory model and the user_inventory model has sale_price. I want to receive the product inventory which has smallest user inventory sale price and also the user_inventory the output show be…
0
votes
0 answers

eager mode and keras.fit have different results

I am trying to convert model.fit() in Keras to the eager mode training. The model is an autoencoder. It has one encoder and two decoders. The decoders have different loss functions. The losses for decoders in eager model and model.fit are the same.…
Mor Mory
  • 1
  • 3
0
votes
1 answer

Call to a member function addEagerConstraints() on null, custom key in model Laravel

I'm refactoring a personal Laravel project and I got blocked in the way of improving it. The function worked this way: 1. Get a collection from the model Thread 2. A foreach loop checks if a User voted that very thread, adding a custom key->value 3.…
0
votes
1 answer

Why EAGER takes time to get result and LAZY causes exception?

I'm trying to get the list of Review of a Movie, when I'm trying to use the FetchType Lazy on Review class It causes LazyInitializationException , When I'm trying @ManyToOne(fetch = FetchType.EAGER) the query is slow and takes time to return…
Angelika
  • 381
  • 1
  • 9
  • 22
1 2 3
8 9