using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace JiShe.CollectBus.Cassandra
{
    public interface ICassandraRepository<TEntity, TKey> where TEntity : class
    {
        Task<TEntity> GetAsync(TKey id);
        Task<TEntity?> GetAsync(string cql, params object[] args);
        Task<TEntity> FirstOrDefaultAsync(TKey id);
        Task<TEntity?> FirstOrDefaultAsync(string cql, params object[] args);
        Task<List<TEntity>?> GetListAsync(string? cql = null, params object[] args);
        Task<TEntity> InsertAsync(TEntity entity);
        Task<TEntity> UpdateAsync(TEntity entity);
        Task DeleteAsync(TEntity entity);
        Task DeleteAsync(TKey id);
        Task<List<TEntity>> GetPagedListAsync(int skipCount, int maxResultCount, string sorting);
    }
}
