lazy-loading

Hibernate lazy loading + Jersey REST = eager loading?

I'm developing a Client-Server-Application with Hibernate as persistence layer and Jersey REST for network communication. Given a user with roles: when I want to display all users in the client, I don't want the roles to be loaded by Hibernate and I don't want them to be sent over the network when I want to modify the user's roles, I...

Best way to override Hibernate's lazy loading in this instance.

Suppose you have class B with lazily loaded property c. And that this is fine everywhere in the system except the following: You have a class A with property b of class B. Whenever you load an entity of type A you want to load the full a.b.c chain non-lazily. Is there a way to set up this type of logic in Hibernate? Edit: A propert...

Entity to DTO conversion with JPA

I'm using DataNucleus as a JPA implementation to store my classes in my web application. I use a set of converters which all have toDTO() and fromDTO(). My issue is, that I want to avoid the whole DB being sent over the wire: If I lazy load, the converter will try to access ALL the fields, and load then (resulting in very eager l...

How can I disable NHibernate lazy loading for a total application?

In a special case we do not want to change mapping files and adding lazy="false" to each of them because of upgrading NHibernate. Is it possible to disable lazy loading in a total application by just adding something to app.config or web.config? ...

NHibernate exception: method Add should be 'public/protected virtual' or 'protected internal virtual'

Take this class as example: public class Category : PersistentObject<int> { public virtual string Title { get; set; } public virtual string Alias { get; set; } public virtual Category ParentCategory { get; set; } public virtual ISet<Category> ChildCategories { get; set; } public /*virtual*/ void Add(Category child...

Lazy loading BelongsTo relation with Castle Active Record?

I have the following mapping for a Relation in Castle AR [BelongsTo("EVENT_ID", Lazy = FetchWhen.OnInvoke)] public EventType PayEvent { get { return m_PayEvent; } set { m_PayEvent = value; } } But the Relatio...

How to use second level cache for lazy loaded collections in Hibernate?

Let's say I have two entities, Employee and Skill. Every employee has a set of skills. Now when I load the skills lazily through the Employee instances the cache is not used for skills in different instances of Employee. Let's Consider the following data set. Employee - 1 : Java, PHP Employee - 2 : Java, PHP When I load Employee - ...

NHibernate: Adding an entity to a lazy loaded many-to-many relationship

We have a entity with a many-to-many collection mapped as a lazy loaded bag. When we load up the entity, the collection is not loaded - great. Now we want to add a new entity to that collection. As soon as we do this, the collection is loaded up. How do we add the new entity without loading up the whole collection (the collection is lar...

Pattern / Framework for lazy population of a database from remote source

My application pulls a large amount of data from an external source - normally across the internet - and stores it locally on the application server. Currently, as a user starts a new project we aggressively try to pull the data from the external source based on the order that we predict the user will want to access it. This process ca...

Nhibernate- Lazy Load initialization fail

Hello All i am facing a problem.I have a 2 Model projects and ProjectChangeRequest. one project have multiple change request. Now on Nhibernate mapping xml file i have taken class like this in Project <class name="Project" table="project" lazy="false"> <id name="ProjectID" column="ProjectID"> <generator class="native" /> ...

Is it possible to configure NHibernate at runtime setting the loading-technique (eager/lazy) for a collection

Ya is this possible :) ? ...

Taking advantage of Hibernate lazy loading?

I have a domain object that has an attribute which is a collection containing another domain object. This is accomplished using a hibernate mapping (which eventually performs a join on another table). Hibernate, by default, seems to lazily instantiate this collection. This turns out to be a great thing because, depending upon what I n...

NHibernate Lazy Initialized collection on WCF Wire

Hi, My object looks something like this: class { int a; object b; IList<string> c; } All the fields are getting populated from the database and the collection is getting lazy initialization which is desirable. Now, my problem is that I want to send this object to the web service. But since the collection is lazily loaded...

WPF textbox in "virtual" mode

Is it possible to use TextBox in "virtual" mode. I want to supply text on demand, when user scrolls through the document. ...

SubSonic 2.2 support for Lazy Laoding

Does SubSonic 2.2 support lazy loading? Can I lazy load a property of an object? If yes, where can I find info on this? ...

nHibernate Lazy Load / Proxied Objects - Persistance Problems

[Updated with mapping files] Ran into an issue with a lazy loaded / proxied object being persisted today. It relates to two classes, Invoice and Address. A invoice has an Address property. Both classes are setup to be lazy loaded and all methods are virtual. In the code I do a Invoice.address = HomeCompany.address and I can verify at ...

Why it's not a good idea to pass entities as Models in MVC?

We're developing a pretty large application with MVC 2 RC2 and we've received some feedback on the way we're using the Entity Framework's Lazy Loading. We're just getting the entities in the controller and sending them as models to the Views, that is causing that the view code asks the Database for the navigation properties we are usin...

Lazy generic delegate initialisation using Ninject

I'm using Ninject 1.0 and would like to be able to inject lazy initialisation delegates into constructors. So, given the generic delegate definition: public delegate T LazyGet<T>(); I'd simply like to bind this to IKernel.Get() so that I can pass a lazy getter into constructors, e.g. public class Foo { readonly LazyGet<Bar> getBa...

Can someone recommend a reliable lazy loading JS plugin for IE6?

This plugin doesn't seem to do the job for IE6 with jQuery 1.3.2 ( haven't tested 1.4.2 ): http://www.appelsiini.net/projects/lazyload ...

How to reduce memory footprint when instantiating a hierarchy of model objects in Cocoa?

I'm writing a quiz application for iPhone using basic NSObject subclasses to represent the models. At runtime the various controllers instantiate the model classes and populate them with data read in from a plist on the disk. The model classes represent the basic hierarchy of a multiple choice quiz: One application has many quizzes O...