pub struct GenericKeyRepository<E, K>{ /* private fields */ }Expand description
通用 Key 内存仓储
Implementations§
Source§impl<E, K> GenericKeyRepository<E, K>
impl<E, K> GenericKeyRepository<E, K>
Trait Implementations§
Source§impl<E, K> Default for GenericKeyRepository<E, K>
impl<E, K> Default for GenericKeyRepository<E, K>
Source§fn default() -> GenericKeyRepository<E, K>
fn default() -> GenericKeyRepository<E, K>
Returns the “default value” for a type. Read more
Source§impl<E, K> Repository<E> for GenericKeyRepository<E, K>
impl<E, K> Repository<E> for GenericKeyRepository<E, K>
Source§fn key_of(
&self,
entity: &E,
) -> <GenericKeyRepository<E, K> as Repository<E>>::Key
fn key_of( &self, entity: &E, ) -> <GenericKeyRepository<E, K> as Repository<E>>::Key
提取实体的主键
Source§fn find_by_id(
&self,
key: &<GenericKeyRepository<E, K> as Repository<E>>::Key,
) -> Result<Option<E>, RepositoryError>
fn find_by_id( &self, key: &<GenericKeyRepository<E, K> as Repository<E>>::Key, ) -> Result<Option<E>, RepositoryError>
按主键查找
Source§fn find_by(
&self,
conditions: &[WhereCondition],
) -> Result<Vec<E>, RepositoryError>
fn find_by( &self, conditions: &[WhereCondition], ) -> Result<Vec<E>, RepositoryError>
按条件查询
Source§fn delete(
&self,
key: &<GenericKeyRepository<E, K> as Repository<E>>::Key,
) -> Result<usize, RepositoryError>
fn delete( &self, key: &<GenericKeyRepository<E, K> as Repository<E>>::Key, ) -> Result<usize, RepositoryError>
按主键删除
Source§fn find_one_by(
&self,
conditions: &[WhereCondition],
) -> Result<Option<E>, RepositoryError>
fn find_one_by( &self, conditions: &[WhereCondition], ) -> Result<Option<E>, RepositoryError>
按条件查询单条
Source§fn batch_update(
&self,
entities: Vec<E>,
) -> Result<BatchUpdateResult<E>, RepositoryError>
fn batch_update( &self, entities: Vec<E>, ) -> Result<BatchUpdateResult<E>, RepositoryError>
批量更新(S-1:SeaORM 对标短板补全) Read more
Source§fn delete_by(
&self,
conditions: &[WhereCondition],
) -> Result<usize, RepositoryError>
fn delete_by( &self, conditions: &[WhereCondition], ) -> Result<usize, RepositoryError>
按条件删除
Source§fn count_by(
&self,
conditions: &[WhereCondition],
) -> Result<u64, RepositoryError>
fn count_by( &self, conditions: &[WhereCondition], ) -> Result<u64, RepositoryError>
按条件计数
Source§fn paginate(
&self,
page: u64,
page_size: u64,
) -> Result<PageResult<E>, RepositoryError>where
E: Clone,
fn paginate(
&self,
page: u64,
page_size: u64,
) -> Result<PageResult<E>, RepositoryError>where
E: Clone,
分页查询
Source§fn paginate_by(
&self,
conditions: &[WhereCondition],
page: u64,
page_size: u64,
) -> Result<PageResult<E>, RepositoryError>where
E: Clone,
fn paginate_by(
&self,
conditions: &[WhereCondition],
page: u64,
page_size: u64,
) -> Result<PageResult<E>, RepositoryError>where
E: Clone,
按条件分页查询
Source§fn find_by_with_or_filter(
&self,
and: &[WhereCondition],
or_filter: &[WhereCondition],
) -> Result<Vec<E>, RepositoryError>where
E: Clone + EntityAttributes,
fn find_by_with_or_filter(
&self,
and: &[WhereCondition],
or_filter: &[WhereCondition],
) -> Result<Vec<E>, RepositoryError>where
E: Clone + EntityAttributes,
按 AND 条件查询,并对结果应用额外的 OR 过滤组 Read more
Auto Trait Implementations§
impl<E, K> !Freeze for GenericKeyRepository<E, K>
impl<E, K> RefUnwindSafe for GenericKeyRepository<E, K>where
K: RefUnwindSafe,
impl<E, K> Send for GenericKeyRepository<E, K>
impl<E, K> Sync for GenericKeyRepository<E, K>
impl<E, K> Unpin for GenericKeyRepository<E, K>
impl<E, K> UnsafeUnpin for GenericKeyRepository<E, K>
impl<E, K> UnwindSafe for GenericKeyRepository<E, K>where
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more