Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 1.0.2
Mapping documents:
<id name='ID' column='DBKEY'>
<generator class='assigned' />
</id>
--> in my table DBKEY is NUMBER 8
C# code:
// definition
private int m_id;
public int ID
{
get { return m_id; }
set { m_id = value; }
}
// code that generate error
MyClass myclass = new MyClass();
myclass.ID = int.Parse(txtNumber.Text);
myclass = (MyClass)this.m_session.Get(typeof(MyClass),myclass); // exception here!
--> i tried even defining ID as long but i got the same error
Full stack trace of any exception that occurs:
Message : identifier type mismatch
Parameter name: id
Stack trace :
in NHibernate.Engine.Key..ctor(Object id, IType identifierType, Object identifierSpace, Type clazz, Boolean isBatchLoadable)
in NHibernate.Engine.Key..ctor(Object id, IClassPersister p)
in NHibernate.Impl.SessionImpl.DoLoad(Type theClass, Object id, Object optionalObject, LockMode lockMode, Boolean checkDeleted)
in NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation)
in NHibernate.Impl.SessionImpl.Get(Type clazz, Object id)
in CUP.frmReservation.mtxtPatient_Leave(Object sender, EventArgs e) in C:\Documents and Settings\luke\Desktop\CUP\CUP\frmReservation.cs:riga 139
in System.Windows.Forms.Control.OnLeave(EventArgs e)
in System.Windows.Forms.Control.NotifyLeave()
in System.Windows.Forms.ContainerControl.UpdateFocusedControl()
in System.Windows.Forms.ContainerControl.AssignActiveControlInternal(Control value)
in System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control, Boolean originator)
in System.Windows.Forms.ContainerControl.SetActiveControlInternal(Control value)
in System.Windows.Forms.ContainerControl.SetActiveControl(Control ctl)
in System.Windows.Forms.ContainerControl.set_ActiveControl(Control value)
in System.Windows.Forms.Control.Select(Boolean directed, Boolean forward)
in System.Windows.Forms.Control.SelectNextControl(Control ctl, Boolean forward, Boolean tabStopOnly, Boolean nested, Boolean wrap)
in System.Windows.Forms.Form.ProcessTabKey(Boolean forward)
in System.Windows.Forms.ContainerControl.ProcessDialogKey(Keys keyData)
in System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
in System.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
in System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
in System.Windows.Forms.Control.PreProcessMessage(Message& msg)
in System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
in System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
in System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
in CUP.frmMain.kbConfirm_Click(Object sender, EventArgs e) in C:\Documents and Settings\luke\Desktop\CUP\CUP\frmMain.cs:riga 469
in System.Windows.Forms.Control.OnClick(EventArgs e)
in ComponentFactory.Krypton.Toolkit.KryptonButton.OnClick(EventArgs e)
in ComponentFactory.Krypton.Toolkit.KryptonButton.OnButtonClick(Object sender, MouseEventArgs e)
in ComponentFactory.Krypton.Toolkit.ButtonController.OnClick(MouseEventArgs e)
in ComponentFactory.Krypton.Toolkit.ButtonController.MouseUp(Control c, Point pt, MouseButtons button)
in ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Control c, Point pt, MouseButtons button)
in ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Control c, Point pt, MouseButtons button)
in ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Control c, Point pt, MouseButtons button)
in ComponentFactory.Krypton.Toolkit.ViewManager.MouseUp(MouseEventArgs e)
in ComponentFactory.Krypton.Toolkit.VisualControl.OnMouseUp(MouseEventArgs e)
in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.Run(Form mainForm)
in CUP.Program.Main() in C:\Documents and Settings\luke\Desktop\CUP\CUP\Program.cs:riga 19
in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
Name and version of the database you are using:Oracle 10g