Skip to content

Commit 675471d

Browse files
Adicionado Parametro para ignorar o bindrtti no find
1 parent aaf3df1 commit 675471d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

SimpleDAO.pas

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ TSimpleDAO<T: class, constructor> = class(TInterfacedObject, iSimpleDAO<T>)
4242
function Update : iSimpleDAO<T>; overload;
4343
function Delete : iSimpleDAO<T>; overload;
4444
{$ENDIF}
45-
function Find : iSimpleDAO<T>; overload;
45+
function Find(aBindList : Boolean = True) : iSimpleDAO<T>; overload;
4646
function Find(var aList : TObjectList<T>) : iSimpleDAO<T> ; overload;
4747
function Find( aId : Integer) : T; overload;
4848
function SQL : iSimpleDAOSQLAttribute<T>;
@@ -146,7 +146,7 @@ destructor TSimpleDAO<T>.Destroy;
146146
inherited;
147147
end;
148148

149-
function TSimpleDAO<T>.Find : iSimpleDAO<T>;
149+
function TSimpleDAO<T>.Find(aBindList : Boolean = True) : iSimpleDAO<T>;
150150
var
151151
aSQL : String;
152152
begin
@@ -162,7 +162,10 @@ function TSimpleDAO<T>.Find : iSimpleDAO<T>;
162162

163163
FQuery.DataSet.DisableControls;
164164
FQuery.Open(aSQL);
165-
TSimpleRTTI<T>.New(nil).DataSetToEntityList(FQuery.DataSet, FList);
165+
166+
if aBindList then
167+
TSimpleRTTI<T>.New(nil).DataSetToEntityList(FQuery.DataSet, FList);
168+
166169
FSQLAttribute.Clear;
167170
FQuery.DataSet.EnableControls;
168171
end;

0 commit comments

Comments
 (0)