123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- //
- // FFDBTransaction.h
- // FFDB
- //
- // Created by Fidetro on 2017/5/12.
- // Copyright © 2017年 Fidetro. All rights reserved.
- //
- // https://github.com/Fidetro/FFDB
- #import <Foundation/Foundation.h>
- @class FFDataBaseModel;
- @interface FFDBTransaction : NSObject
- /**
- select all object
-
- @param dbClass by class
- @return class objects
- */
- + (NSArray <__kindof FFDataBaseModel *>*)selectObjectWithFFDBClass:(Class)dbClass;
- /**
- select object by format
-
- @param dbClass by class
- @param format Like sqlstatement rule, example: where name = 'fidetro' and age = '21'
- @return class objects
- */
- + (NSArray <__kindof FFDataBaseModel *>*)selectObjectWithFFDBClass:(Class)dbClass format:(NSString *)format;
- /**
- insert object
-
- @param objectList Need to insert the array of objects
- */
- + (void)insertObjectList:(NSArray <__kindof FFDataBaseModel *>*)objectList
- isRollBack:(BOOL)isRollBack;
- /**
- update object
-
- @param objectList Need to update the array of objects
- */
- + (void)updateObjectList:(NSArray<__kindof FFDataBaseModel *> *)objectList
- isRollBack:(BOOL)isRollBack;
- /**
- update object by format
-
- @param dbClass Need to update the class
- @param format Like sqlstatement rule, example: set age = '24' where name = 'fidetro'
- @return update successfully
- */
- + (BOOL)updateObjectWithFFDBClass:(Class)dbClass
- format:(NSString *)format
- isRollBack:(BOOL)isRollBack;
- /**
- delete object
-
- @param objectList Need to delete the array of objects
- */
- + (void)deleteObjectList:(NSArray<__kindof FFDataBaseModel *> *)objectList
- isRollBack:(BOOL)isRollBack;
- /**
- delete object by format
-
- @param dbClass Need to update the class
- @param format format Like sqlstatement rule, example: where name = 'fidetro' and age = '21'
- @return delete successfully
- */
- + (BOOL)deleteObjectWithFFDBClass:(Class)dbClass
- format:(NSString *)format
- isRollBack:(BOOL)isRollBack;
- /**
- custom query SQL
-
- @param toClass return toClass Object
- @param format SQL statement exmaple:select * from person
- @return return this class Objects
- */
- + (NSArray <__kindof FFDataBaseModel *>*)selectDBToClass:(Class)toClass
- SQLStatementWithFormat:(NSString *)format;
- /**
- custom update
-
- @param format SQL statement
- @return isSuccess
- */
- /**
- custom update
- @param format SQL statement
- @return isSuccess
- */
- + (BOOL)updateDBWithSQLStatementWithFormat:(NSString *)format
- isRollBack:(BOOL)isRollBack;
- @end
|