Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
NHibernate version: 1.0.2
Name and version of the database you are using: SQLServer 2005
Hello,
I have following problem:
In my project I have an object Order, which is connected with Validity. In Validity there are two Time objects - each has DateTime property and code property. In ORDER table Validity is mapped as component (columns with foreign key for Time objects - START_TIME and END_TIME). The relation in <component> is many-to-one. I set fetch="join" for both START_TIME and END_TIME. When I retrieve Order from database startTime in Validity is loaded properly, but endTime is not and I get LazyInitializationException. In mapping of Time lazy is set to true. If I set it to false - everything works just fine. But with lazy=true I keep getting LazyInitializationException. What should I do to load both Time objects in Validity when retrieving Order from database ?
Best regards.
tytus