Recent

Author Topic: About compatibility between SQLDB TDataset and Zeos TAbstrasctDataset  (Read 858 times)

gelinp

  • Full Member
  • ***
  • Posts: 114
Hi,

I'm building adaptators for DB components in order to not modify my application if I choose SLQB compoents or zeoslib.So I use a factory class to bluid a TDatabaseManager with only a generic interface, without any referencesto  specifics types from SQLDB or zeoslib techicals libraries. Si this my DAO généric class using the factory and manager TDatabaseManager :

Code: Pascal  [Select][+][-]
  1. IDAOClasse = specialize IDAO<TClasse>;
  2.  
  3. TDAOClasse = class(IDAOClasse)
  4. private
  5.   sgDbm : TDatabaseManager;
  6. public
  7.   constructor Construire(dbm : TDatabaseManager);
  8.   destructor Detruire;
  9.   function Ajouter(const obj : TClasse) : TClasse; override; // Ajoute un nouvel objet T
  10.   function Instancier(const id : integer) : TClasse; override; // Lire un objet T existant
  11.   function Collection(strSQL : String) : TDataset; override;
  12.   function Sauvegarder(const obj : TClasse) : TClasse; override; // Mémoriser un objet T
  13.   procedure Supprimer(obj : TClasse); override; // Supprimer un objet T
  14.  end;

My question is about the method :

Code: Pascal  [Select][+][-]
  1.   function Collection(strSQL : String) : TDataset; override;

If I use zeoslib inside the implementation of TDatabaseManager, I will use a TZQuery with TZAbstractDataset. Do you think it will be compatible with a TDataset result ?
« Last Edit: January 24, 2016, 08:56:17 pm by gelinp »
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

 

TinyPortal © 2005-2018