/// <summary>
        /// Takes a keyValuepair argument of i_chronicleId=x or r_object_id=x
        /// </summary>
        /// <param name="type"></param>
        /// <param name="obj"></param>
        /// <param name="itemsPerPage"></param>
        /// <returns></returns>
        public Feed <AuditEntry> GetAuditHistory(HistoryType type, PersistentObject obj, int itemsPerPage)
        {
            String auditQueryAttribute = "";
            String id = "";

            switch (type)
            {
            case HistoryType.FULLVERSIONTREE:
                id = (String)obj.GetPropertyValue("i_chronicle_id");
                auditQueryAttribute = "chronicle_id";
                break;

            case HistoryType.THISDOCUMENTONLY:
                id = (String)obj.GetPropertyValue("r_object_id");
                auditQueryAttribute = "audited_obj_id";
                break;
            }
            String dql = String.Format("select * from dm_audittrail where {0}='{1}'", auditQueryAttribute, id);

            return(ExecuteDQL <AuditEntry>(dql, new FeedGetOptions()
            {
                ItemsPerPage = itemsPerPage, IncludeTotal = true
            }));
        }
 /// <summary>
 /// Default convenience version of getDocumentHistory that returns 10 audit entries per page by default.
 /// </summary>
 /// <param name="type"></param>
 /// <param name="obj"></param>
 /// <returns></returns>
 public Feed <AuditEntry> GetAuditHistory(HistoryType type, PersistentObject obj)
 {
     return(GetAuditHistory(type, obj, 10));
 }