Joined: Thu Jun 03, 2010 8:21 am Posts: 1
|
Hi Everyone,
I am from turkey. I am developing a application with nhibernate. In the all my tables there is three columns as
row_guid row_version row_status. I have write a class like this
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace Maniac.Core.Database { public abstract class MncDbObject { #region Fields
private Guid rowGuid; private long rowVersion; private int rowStatus;
#endregion
#region Properties
public virtual Guid RowGuid { get { return rowGuid; } set { rowGuid = value; } }
public virtual long RowVersion { get { return rowVersion; } set { rowVersion = value; } }
public virtual int RowStatus { get { return rowStatus; } set { rowStatus = value; } }
#endregion
#region Methods public void Delete() { MncDbSessionManager.GetSession().Delete(this); }
public void Save() { MncDbSessionManager.GetSession().Save(this); }
public void SaveOrUpdate() { MncDbSessionManager.GetSession().SaveOrUpdate(this); }
public void Update() { MncDbSessionManager.GetSession().Update(this); } #endregion } }
. This is my base table class and my all entities will extends this. But i create an appropriate hbm.xml file for tables. So i want to write a pojo like this.
using System; using System.Collections.Generic; using System.Text; using Maniac.Core.Database;
namespace Maniac.Core.Test2 { public class DenemeTablo1 : MncDbObject { #region Fields
private string adi; private string soyadi;
#endregion
#region Properties
public virtual string Adi { get { return adi; } set { adi = value; } }
public virtual string Soyadi { get { return soyadi; } set { soyadi = value; } }
#endregion } }. Table of this pojo has 5 five columns. 3 of these is in the base class.
Can u help me how to create a DenemeTablo1.hbm.xml file.
Thanks
|
|