Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.0.1.GA
Mapping documents: Attributes
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
SQL Server 2008
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A
In my entities I map a integer property for my foreign key columns. That works fine.
Currently I also map a property of entity type for the same foreign key columns. My many-to-one mapping is setup to Lazy load. But this property and mapping is really only there so I can build ICriteria queries that include the associated entities.
I need to map my many-to-one associations such that I can build ICriteria queries over them, but I don't want NHibernate to ever load the associated type into my propery. I don't want NHibernate to either load them Lazy or Eager. I have dependency injected my entity properties so that they can load themself either using a factoried DAO (business tier) or a factoried WCF Proxy (client teir).
I suppose I can can use HQL queries allow searches on associated entities, but also to prevent their loading. But I already have a nice abstraction layer that makes it easy for my developers build a search using property paths. And it was easy to directly map from my abstraction to Restrictions.
I would hate to have to start building HQL/SQL dynamically.
Right now, on my entity property many-to-one associations, I have insert="false" and update="false" and on the corresponding integer property I have the inverse.
Is there anything semantically equivalent to load="false" in a many-to-one mapping?