Load the data for the object with the specified id into a newly created object using "for update", if supported. A new key will be assigned to the object. This should return an existing proxy where appropriate. If the object does not exist in the database, an exception is thrown.

Namespace: NHibernate.Impl
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public Object Load(
	Type entityClass,
	Object id,
	LockMode lockMode
)
Visual Basic
Public Function Load ( _
	entityClass As Type, _
	id As Object, _
	lockMode As LockMode _
) As Object
Visual C++
public:
virtual Object^ Load(
	Type^ entityClass, 
	Object^ id, 
	LockMode^ lockMode
) sealed

Parameters

entityClass
Type: System..::..Type

[Missing <param name="entityClass"/> documentation for "M:NHibernate.Impl.SessionImpl.Load(System.Type,System.Object,NHibernate.LockMode)"]

id
Type: System..::..Object

[Missing <param name="id"/> documentation for "M:NHibernate.Impl.SessionImpl.Load(System.Type,System.Object,NHibernate.LockMode)"]

lockMode
Type: NHibernate..::..LockMode

[Missing <param name="lockMode"/> documentation for "M:NHibernate.Impl.SessionImpl.Load(System.Type,System.Object,NHibernate.LockMode)"]

Return Value

[Missing <returns> documentation for "M:NHibernate.Impl.SessionImpl.Load(System.Type,System.Object,NHibernate.LockMode)"]

Implements

ISession..::..Load(Type, Object, LockMode)

Exceptions

ExceptionCondition
NHibernate..::..ObjectNotFoundException Thrown when the object with the specified id does not exist in the database.

See Also