I am using SetSourceCriteria.
I have implemented the Listerners to get the SQL, I have found other things also.
First, the Take(20) does not show in the SQL:
Debug Output:
2014-07-22 21:27:31:432 [] [Aurelius SQL] SELECT A.PJIDITEM AS A_PJIDITEM, A.CODIGOFABRICANTE AS A_CODIGOFABRICANTE, A.NAOINCLUIRINVENTARIO AS A_NAOINCLUIRINVENTARIO, A.NAOVENDERESTOQUEZERO AS A_NAOVENDERESTOQUEZERO, A.NAOUSARETIQUETA AS A_NAOUSARETIQUETA, A.NAOALTERARABC AS A_NAOALTERARABC, A.UNIDADEEQUIVALENCIA AS A_UNIDADEEQUIVALENCIA, A.PESO AS A_PESO, A.COMPRIMENTO AS A_COMPRIMENTO, A.LARGURA AS A_LARGURA, A.ALTURA AS A_ALTURA, A.VOLUME AS A_VOLUME, A.DISPONIVEL AS A_DISPONIVEL, A.TIPOPRODUTO AS A_TIPOPRODUTO, B.ID AS B_ID, B.DOMINIO AS B_DOMINIO, B.OWNER AS B_OWNER, B.CODIGO AS B_CODIGO, B.NOME AS B_NOME, B.DESCRICAO AS B_DESCRICAO, B.REFERENCIA AS B_REFERENCIA, B.ATIVO AS B_ATIVO, B.NAOVENDER AS B_NAOVENDER, B.PRECOVENDA AS B_PRECOVENDA, B.AJIDGRUPO AS B_AJIDGRUPO, B.AJIDICMS AS B_AJIDICMS, B.AJIDITEMVENDA AS B_AJIDITEMVENDA, A.AJIDUNIDADEUSO AS A_AJIDUNIDADEUSO, A.AJIDUNIDADECOMPRA AS A_AJIDUNIDADECOMPRA, A.AJIDMARCA AS A_AJIDMARCA, A.AJIDFABRICANTEROTULO AS A_AJIDFABRICANTEROTULO
FROM ITEMPRODUTO
Process NaharFMX.exe (1844)
Debug Output: 2014-07-22 21:27:31:438 [] [Aurelius SQL Param] p_0 = "1" (ftInteger) Process NaharFMX.exe (1844)
The process of opening my Item Edit Form was too slow, first I was thinking that is because Aurelius was retrieving the entire table, that is really happening but the problem is something else.
After this Select is done, Aurelius start querying this select:
Debug Output:
2014-07-22 21:27:31:747 [] [Aurelius SQL] SELECT A.PICTURE As f0_
FROM ITEM A
LEFT JOIN ITEMSERVICO B ON (B.PJIDITEM = A.ID)
LEFT JOIN ITEMPRODUTO C ON (C.PJIDITEM = A.ID)
WHERE A.ID = :p_0
Process NaharFMX.exe (1844)
Debug Output: 2014-07-22 21:27:31:752 [] [Aurelius SQL Param] p_0 = "{006CE261-B582-44FD-A852-F4065F287092}" (ftGuid) Process NaharFMX.exe (1844)
FOR EACH ITEM ON THE TABLE !
TAureliusDataSet is connected to a BindSource that is connected to a TListVIew
When I remove the bind link from my TEntityItem.Picture to the Item.Bitmap on the Listview this loop of queries stops.
Picture is declared:
public
[Column('PICTURE', [TColumnProp.Lazy])]
property Picture: TBlob read GetPicture write SetPicture;
What I could learn from it is that TColumnProp.Lazy when removed this problem gone, because the SQL was generated including the Picture.
That is the expected behavior?
Back to the original question, why take(20) is not there?
Another question on that is: Do I need to really have to page for each 20 items for example? How is that done? can I when reach EOF try another page? I am not sure how to deal with that in a way more fluent, I believe the Entities in memory should be created progressively when needed for such a case.
Thanks
Eduardo