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):
...
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],
...
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...
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...
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...
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...