Having trouble with a stubborn problem loading some objects from the database, and can't see where I'm going wrong. When I perform the load call, I get a thrown exception: "identifier type mismatch" "id".
From the mapping file:
Code:
<id name="IntervalId" column="interval_id" type="Int32">
<generator class="native" />
</id>
And where used:
Code:
Public Function load(ByVal inType As System.Type, ByVal inPK As Long) As Object
Dim session As ISession = Nothing
Dim loadedObj As Object
session = m_sessionFactory.OpenSession
loadedObj = session.Load(inType, inPK)
session.Close()
Return loadedObj
End Function
In the database (MS Access) the column is an AutoNumber.
Where have I gone wrong?
Actually, looking at it I changed the inPK parameter to an Integer, and the load function works. Is the Integer sufficient for an AutoNumber column, or do I need a Long? If I declare the id as an Int64 instead of an Int32, will that work with the Long? I don't see anything mapped to a Long type in the documentation here:
http://nhibernate.sourceforge.net/nh-do ... ping-types
Like I said, I have it working now, so at this point, I am just trying to get a better understanding of it. Thanks for your help!