Hxj.Data 数据库组件文档 下载本文

目前支持Sql2000\\2005,MsAccess,Oracle,SQLite,MySQL,如有需要可再扩展。

数据库实体生成的代码Northwind数据库中Products表:

//------------------------------------------------------------------------------ // // 此代码由工具生成。

// 运行时版本:2.0.50727.4200 //

// 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 //

//------------------------------------------------------------------------------

using System; using System.Data;

using System.Data.Common; using Hxj.Data;

using Hxj.Data.Common;

namespace Hxj.Model {

///

/// 实体类Products 。(属性说明自动提取数据库字段的描述信息) ///

[Serializable]

public class Products : Entity {

public Products():base(\) {}

#region Model

private int _ProductID; private string _ProductName; private int? _SupplierID; private int? _CategoryID;

private string _QuantityPerUnit; private decimal? _UnitPrice; private int? _UnitsInStock; private int? _UnitsOnOrder; private int? _ReorderLevel; private bool _Discontinued; ///

///

5

///

public int ProductID {

get{ return _ProductID; } set {

this.OnPropertyValueChange(_.ProductID,_ProductID,value); this._ProductID=value; } }

///

///

///

public string ProductName {

get{ return _ProductName; } set {

this.OnPropertyValueChange(_.ProductName,_ProductName,value); this._ProductName=value; } }

///

///

///

public int? SupplierID {

get{ return _SupplierID; } set {

this.OnPropertyValueChange(_.SupplierID,_SupplierID,value); this._SupplierID=value; } }

///

///

///

public int? CategoryID {

get{ return _CategoryID; } set {

this.OnPropertyValueChange(_.CategoryID,_CategoryID,value); this._CategoryID=value;

6

} }

///

///

///

public string QuantityPerUnit {

get{ return _QuantityPerUnit; } set {

this.OnPropertyValueChange(_.QuantityPerUnit,_QuantityPerUnit,value); this._QuantityPerUnit=value; } }

///

///

///

public decimal? UnitPrice {

get{ return _UnitPrice; } set {

this.OnPropertyValueChange(_.UnitPrice,_UnitPrice,value); this._UnitPrice=value; } }

///

///

///

public int? UnitsInStock {

get{ return _UnitsInStock; } set {

this.OnPropertyValueChange(_.UnitsInStock,_UnitsInStock,value); this._UnitsInStock=value; } }

///

///

///

public int? UnitsOnOrder {

get{ return _UnitsOnOrder; }

7

set {

this.OnPropertyValueChange(_.UnitsOnOrder,_UnitsOnOrder,value); this._UnitsOnOrder=value; } }

///

///

///

public int? ReorderLevel {

get{ return _ReorderLevel; } set {

this.OnPropertyValueChange(_.ReorderLevel,_ReorderLevel,value); this._ReorderLevel=value; } }

///

///

///

public bool Discontinued {

get{ return _Discontinued; } set {

this.OnPropertyValueChange(_.Discontinued,_Discontinued,value); this._Discontinued=value; } }

#endregion

#region Method ///

/// 获取实体中的标识列 ///

public override Field GetIdentityField() {

return _.ProductID; }

///

/// 获取实体中的主键列 ///

public override Field[] GetPrimaryKeyFields()

8