eager-loading

joinedload / eager loading whole (sub)-graphs in sqlalchemy

Let's say I have a Task object which can be dependent on other Tasks. Is there a way to sensibly eager/joinedload all of a given set of task's subtasks? class Task(DeclarativeBase): __tablename__ = 'task' task_id = Column(Integer, primary_key=True) name = Column(String, unique=True) def add_dependencies(self, *tasks): ...

Thinking Sphinx search with two classes and eager loading

I use TS to search trough 2 models (classes) at the same time: class Product < ActiveRecord::Base belongs_to :user belongs_to :photo has_many :variants end class Article < ActiveRecord::Base belongs_to :user belongs_to :photo end In controller: @item_facets = ThinkingSphinx.facets( options[:search], ...

Linq to entities - how to select entities with a where condition on their entitycollection ?

Hi all, I found several times people asking for the same question but it seems that the answer was never satisfying altough it should be pretty easy (in theory). Here is my question : I have an entity called "Company" inside which I have an entityCollection "Employees" (one to many). I need to retrieve all Companies and for each of the...

NHibernate double fetching for non-existent many-to-one relationship

I have an entity with several Many to One relationships and I've found I can eagerly fetch them in one query like such: public Accommodation GetEager(int id) { IList<Accommodation> query = NHibernateSession.CurrentFor(NHibernateSession.DefaultFactoryKey) .CreateQuery(@" select a from Accommodation as a left j...

Force eager loading of otherwise lazy loaded properties

Hi. I've got a Hibernate object which's properties are all loaded lazy. Most of these properties are other Hibernate objects or PersistentSets. Now I want to force Hibernate to eager load these properties for just one time. Of course I could "touch" each of these properties with object.getSite().size() but maybe there's another way to...

Entity Framework 4 Abstract Model - How to Programatically Eager-Load Navigational Properties?

Hi Guys, I have an EF4 Model that is built with abstract entities/classes: Notice how State entity has a navigational property called Country. Note: I have lazy-loading disabled, so i must eager-load on demand. Now, if i have the following method: public Location FindSingle(int id) { return _repository.Find().WithId(id).SingleO...