Practical .NET Data Access Layer - 4

zhaozj2021-02-16  46

Code 3: My Data Entity - 1, Data Entity in the app

// mycustomer: Contains the Customer of the Basic Field, supports the data list, inheriting from myDef

[Serializable ()]

Public class mycustomer: mydef

{

Public String ID;

Public String Name;

Public string phone;

Public mycustom () {}

PUBLIC MyCustom (ArrayList Al): Base (Al) {}

}

// myDef: Provides the Data Entity support required for the current application,

/ / Including O / R Mapping, XML, inheriting from DEFBASE

[Serializable ()]

Public Class MyDef: Defbase, IList, IenuMerable

{

// o / r mapping fields

[Nonserialized ()]

Protected intenal objectSet _ostorm = NULL;

...

// XML Fields

[Nonserialized ()]

Protected interunal xmlnode _xmlnode = NULL;

...

Public mydef () {}

Public MyDef (ArrayList Al): Base (Al) {}

Public MyDef (ObjectSet OSTORM)

{

THIS._OSTORM = OSTORM;

THIS._TYPEENTITY =

MyentityType.orm_ObjectSpaces_ObjectSet;

}

Public MyDef (XMLNode XMLNode)

{

THIS._XMLNODE = XMLNode;

THIS._TYPEENTITY = myentitytype.xml_node;

}

...

}

Next paragraph: http://www.9cbs.net/develop/read_article.asp? Id = 27547

转载请注明原文地址:https://www.9cbs.com/read-24104.html

New Post(0)