Websharp使用说明(7)
2024-07-21 02:17:16
供稿:网友
附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();
}