-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIObjectStore.cs
More file actions
61 lines (49 loc) · 2.45 KB
/
IObjectStore.cs
File metadata and controls
61 lines (49 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Data;
namespace SharpQuant.ObjectStore
{
public interface IObjectStore
{
//Access to the serializer
IObjectSerializer Serializer { get; }
// Gets a single catalogue
ICatalogue GetCatalogue(string code);
// Creates a new catalogue (think table in a DB)
bool CreateCatalogue(ICatalogue catalogue, bool dropifexists = false);
// Careful! Deletes entire catalogue!
bool DeleteCatalogue(string code);
// Updates catalogue information
bool UpdateCatalogue(ICatalogue catalogue);
//gets all the catalogues
IList<ICatalogue> GetCatalogues();
// Deletes all versions of an object! Returns how many records where deleted.
int DeleteObject(string catalogue, string ID);
// Deletes a specific version of an object! Returns how many records where deleted.
int DeleteObject(string catalogue, string ID, DateTime version);
//check whether a particular version exists
bool Exist(string catalogue, string DBID, DateTime version);
//last version of an ID
DateTime LastVersion(string catalogue, string ID);
//last version before 'version'
DateTime LastVersion(string catalogue, string ID, DateTime version);
//Create or update a serialized object
//tags will be overwritten if updateinfo = true
bool CreateOrUpdate<T>(IObjectInfo<T> info, bool updateInfo = true);
bool CreateOrUpdate(IObjectInfo info, bool updateInfo = true);
//get last version
IObjectInfo<T> GetObject<T>(string catalogue, string ID);
//get last version before 'version'
IObjectInfo<T> GetObject<T>(string catalogue, string ID, DateTime version);
//get last version
IObjectInfo GetObjectInfo(string catalogue, string ID);
//get last version before 'version'
IObjectInfo GetObjectInfo(string catalogue, string ID, DateTime version);
//Gets all infos without deserializing the objects of the entire catalogue
IList<IObjectInfo> GetAllInfos(string catalogue, string type = "%", bool read_data = false);
//Gets all infos without deserializing the objects for an ID
IList<IObjectInfo> GetAllInfosForID(string catalogue, string ID, bool read_data = false);
//Transaction support
IDbTransaction BeginTransaction(IsolationLevel il = IsolationLevel.Unspecified);
}
}