pub trait BaseMapper {
    type Item;

    fn insert<I, M: AkitaMapper>(
        &self,
        entity_manager: &M
    ) -> Result<Option<I>, AkitaError>
   where
        Self::Item: GetTableName + GetFields,
        I: FromValue
; fn insert_batch<M: AkitaMapper>(
        datas: &[&Self::Item],
        entity_manager: &M
    ) -> Result<(), AkitaError>
   where
        Self::Item: GetTableName + GetFields
; fn update<M: AkitaMapper>(
        &self,
        wrapper: Wrapper,
        entity_manager: &M
    ) -> Result<u64, AkitaError>
   where
        Self::Item: GetTableName + GetFields
; fn list<M: AkitaMapper>(
        wrapper: Wrapper,
        entity_manager: &M
    ) -> Result<Vec<Self::Item>, AkitaError>
   where
        Self::Item: GetTableName + GetFields + FromValue
; fn page<M: AkitaMapper>(
        page: usize,
        size: usize,
        wrapper: Wrapper,
        entity_manager: &M
    ) -> Result<IPage<Self::Item>, AkitaError>
   where
        Self::Item: GetTableName + GetFields + FromValue
; fn find_one<M: AkitaMapper>(
        wrapper: Wrapper,
        entity_manager: &M
    ) -> Result<Option<Self::Item>, AkitaError>
   where
        Self::Item: GetTableName + GetFields + FromValue
; fn find_by_id<I: ToValue, M: AkitaMapper>(
        &self,
        entity_manager: &M,
        id: I
    ) -> Result<Option<Self::Item>, AkitaError>
   where
        Self::Item: GetTableName + GetFields + FromValue
; fn update_by_id<M: AkitaMapper>(
        &self,
        entity_manager: &M
    ) -> Result<u64, AkitaError>
   where
        Self::Item: GetFields + GetTableName + ToValue
; fn delete<M: AkitaMapper>(
        &self,
        wrapper: Wrapper,
        entity_manager: &M
    ) -> Result<u64, AkitaError>
   where
        Self::Item: GetFields + GetTableName + ToValue
; fn delete_by_id<I: ToValue, M: AkitaMapper>(
        &self,
        entity_manager: &M,
        id: I
    ) -> Result<u64, AkitaError>
   where
        Self::Item: GetFields + GetTableName + ToValue
; fn count<M: AkitaMapper>(
        &mut self,
        wrapper: Wrapper,
        entity_manager: &M
    ) -> Result<usize, AkitaError>; }

Required Associated Types

Required Methods

Insert a record

Insert Data Batch.

Update Data With Wrapper.

Query all records according to the entity condition

Query all records (and turn the page) according to the entity condition

Find One With Wrapper.

Find Data With Table’s Ident.

Update Data With Table’s Ident.

Delete Data With Wrapper.

Delete by ID

Get the Table Count.

Implementors