public void SaveItem(InventoryItem item)
        {
            var statement = FOLDER_ITEM_UPDATE_STMT.Bind(item.Name, item.AssetId, item.AssetType, item.BasePermissions, item.CreationDate, item.CreatorId,
                item.CurrentPermissions, item.Description, item.EveryonePermissions, item.Flags, item.GroupId, item.GroupOwned, item.GroupPermissions,
                item.InventoryType, item.NextPermissions, item.SaleType, item.FolderId, item.ItemId);

            _session.Execute(statement);
            VersionInc(item.OwnerId, item.FolderId);
        }
        public void MoveItem(InventoryItem item, InventoryFolder parentFolder)
        {
            var insert = FOLDER_ITEM_INSERT_STMT.Bind(parentFolder.FolderId, item.ItemId, item.Name, item.AssetId, item.AssetType,
                item.BasePermissions, item.CreationDate, item.CreatorId, item.CurrentPermissions, item.Description, item.EveryonePermissions,
                item.Flags, item.GroupId, item.GroupOwned, item.GroupPermissions, item.InventoryType, item.NextPermissions,
                item.OwnerId, item.SaleType);

            var removeOld = FOLDER_ITEM_REMOVE_STMT.Bind(item.FolderId, item.ItemId);

            var ownershipUpdate = ITEM_OWNERSHIP_UPDATE.Bind(parentFolder.FolderId, item.ItemId);

            var batch = new BatchStatement()
                .Add(insert)
                .Add(ownershipUpdate)
                .Add(removeOld);

            _session.Execute(batch);

            VersionInc(item.OwnerId, item.FolderId);
            VersionInc(item.OwnerId, parentFolder.FolderId);
        }
        public void PurgeItem(InventoryItem item)
        {
            var removeItem = FOLDER_ITEM_REMOVE_STMT.Bind(item.FolderId, item.ItemId);
            var removeOwnership = ITEM_OWNERSHIP_REMOVE.Bind(item.ItemId);

            var batch = new BatchStatement()
                .Add(removeItem)
                .Add(removeOwnership);

            _session.Execute(batch);

            VersionInc(item.OwnerId, item.FolderId);
        }
        public void CreateItem(InventoryItem item)
        {
            var folderInsert = FOLDER_ITEM_INSERT_STMT.Bind(item.FolderId, item.ItemId, item.Name, item.AssetId, item.AssetType,
                item.BasePermissions, item.CreationDate, item.CreatorId, item.CurrentPermissions, item.Description, item.EveryonePermissions,
                item.Flags, item.GroupId, item.GroupOwned, item.GroupPermissions, item.InventoryType, item.NextPermissions,
                item.OwnerId, item.SaleType);

            var itemOwnership = ITEM_OWNERSHIP_INSERT.Bind(item.ItemId, item.FolderId);

            var batch = new BatchStatement()
                .Add(folderInsert)
                .Add(itemOwnership);

            _session.Execute(batch);

            VersionInc(item.OwnerId, item.FolderId);
        }