X-Git-Url: https://code.grnet.gr/git/pithos-ms-client/blobdiff_plain/eeee29e3789c76bb4fff5a56e3d0fb80683a7c34..7d915c34d5a6ec34fe8b5b821f89630eae739a32:/trunk/Pithos.Core/FileState.cs?ds=sidebyside diff --git a/trunk/Pithos.Core/FileState.cs b/trunk/Pithos.Core/FileState.cs index e3303a3..f751f81 100644 --- a/trunk/Pithos.Core/FileState.cs +++ b/trunk/Pithos.Core/FileState.cs @@ -5,6 +5,7 @@ // ----------------------------------------------------------------------- using Castle.ActiveRecord; +using Castle.ActiveRecord.Framework; using Pithos.Interfaces; namespace Pithos.Core @@ -18,10 +19,18 @@ namespace Pithos.Core /// TODO: Update summary. /// [ActiveRecord] - public class FileState:ActiveRecordBase + public class FileState:ActiveRecordLinqBase { + private string _filePath; + private IList _tags=new List(); + + [PrimaryKey] - public string FilePath { get; set; } + public string FilePath + { + get { return _filePath; } + set { _filePath = value.ToLower(); } + } [Property] public FileOverlayStatus OverlayStatus { get; set; } @@ -31,5 +40,29 @@ namespace Pithos.Core [Property] public string Checksum { get; set; } + + [HasMany(Cascade=ManyRelationCascadeEnum.AllDeleteOrphan,Lazy=true)] + public IList Tags + { + get { return _tags; } + set { _tags=value;} + } + + } + + [ActiveRecord] + public class FileTag : ActiveRecordLinqBase + { + [PrimaryKey] + public string FilePath { get; set; } + + [Property] + public string Value { get; set; } + + [BelongsTo("FilePath")] + public FileState FileState { get; set; } + } + + }