Websharp使用说明(7)

80酷酷网    80kuku.com

  web附1:Websharp主要接口定义:



PersistenceCapable:

public interface PersistenceCapable

{

EntityData EntityData{get;set;}

int ObjectCount{get;}

void AddNew();

bool Next();

void First();

}



PersistenceManager:

public interface PersistenceManager : IDisposable

{

void Close();

bool IsClosed{get;}

Transaction CurrentTransaction{ get;}

bool IgnoreCache{get;set;}



void PersistNewObject(EntityData entity);

void PersistNewObject(PersistenceCapable pc);

void UpdateObject(EntityData entity);

void UpdateObject(PersistenceCapable pc);

void DeleteObject(EntityData entity);

void DeleteObject(PersistenceCapable pc);

void Reload(EntityData entity);

void Reload(PersistenceCapable pc);

void Evict (object pc);

void EvictAll (object[] pcs);

void EvictAll (ICollection pcs);

void EvictAll ();

EntityData FindEntityDataByPrimaryKey(object id,string entityTypeName);

EntityData FindEntityDataByPrimaryKey(object id,EntityData entity);

PersistenceCapable FindObjectByPrimaryKey(object id,PersistenceCapable pc);

PersistenceCapable FindObjectByPrimaryKey(object id,Type entityType);



Query NewQuery();

Query NewQuery(string entityTypeName);

Query NewQuery(string entityTypeName,string filter);

Query NewQuery(string entityTypeName,string filter,QueryParameterCollection paramColletion);



DataAccess NewDataAccess();

}




Transaction:

public interface Transaction

{

void Begin();

void Commit();

void Rollback();

PersistenceManager PersistenceManager{get;}

}




Query:

public interface Query

{

string EntityTypeName{get;set;}

string Filter{get;set;}



QueryParameterCollection Parameters

{

get;

set;

}

string Ordering{get;set;}



bool IgnoreCache{get;set;}



EntityData QueryData();

PersistenceCapable QueryObject(PersistenceCapable ps);

EntityData LoadSubObject(EntityData entity,string subTypeName);

PersistenceCapable QueryObject(PersistenceCapable ps,string subTypeName);

EntityData LoadSubObjects(EntityData entity);





PersistenceManager PersistenceManager{get;}



bool QuerySubObjects{get;set;}

bool IsClosed{get;}

void Close ();

void Open();

}

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: