BaseModelQuery<M extends Model, D> class abstract

basic implement for AbstractModelQuery

Inheritance

Constructors

BaseModelQuery(ModelInspector modelInspector, Database db, {BaseModelQuery<Model, dynamic>? topQuery, String? propName})

Properties

alias String
no setter
className String
no setter
columns List<ColumnQuery>
no setter
db Database
final
hashCode int
The hash code for this object.
no setterinherited
joins List<BaseModelQuery<Model, dynamic>>
no setter
maxRows int
getter/setter pair
modelInspector ModelInspector
final
offset int
getter/setter pair
orders List<OrderField>
getter/setter pair
propName String?
getter/setter pair
queryMap Map<String, BaseModelQuery<Model, dynamic>>
final
relatedQuery BaseModelQuery<Model, dynamic>?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
topQuery BaseModelQuery<Model, dynamic>
no setter

Methods

count({bool includeSoftDeleted = false}) Future<int>
return count of this query.
override
delete() Future<int>
return how many rows affected!
override
deleteOne(M model) Future<void>
deleteOnePermanent(M model) Future<void>
deletePermanent() Future<int>
return how many rows affected!
override
findBy(Map<String, dynamic> params, {List<Model>? existModeList, bool includeSoftDeleted = false}) Future<List<M>>
find models by params
override
findById(D id, {M? existModel, bool includeSoftDeleted = false}) Future<M?>
find single model by id if existModel is given, existModel will be filled and returned, otherwise a new model will be returned.
override
findByIds(List idList, {List<Model>? existModeList, bool includeSoftDeleted = false}) Future<List<M>>
find models by idList
override
findList({bool includeSoftDeleted = false}) Future<List<M>>
find list
override
findListBySql(String rawSql, [Map<String, dynamic> params = const {}]) Future<List<M>>
select with raw sql. example: findListBySql(' select distinct(t.*) from table t, another_table t2 where t.column_name=t2.id and t.column_name2=@param1 and t2.column_name3=@param2 order by t.id, limit 10 offset 10 ', {'param1':100,'param2':'hello'})
override
findQuery<T extends BaseModelQuery<Model, dynamic>>(Database db, String modelName, String propName) → T
insert(M model) Future<int>
insertBatch(List<M> modelList, {int batchSize = 100}) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paging(int pageNumber, int pageSize) → dynamic
toModel<N extends M>(List dbRow, List<OrmMetaField> selectedFields, String className, {N? existModel}) → N
toString() String
A string representation of this object.
inherited
update(M model) Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited