Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
450 changes: 221 additions & 229 deletions Code4DGeraClasses.dproj

Large diffs are not rendered by default.

Binary file added Postgress/lib32/pgenlist.pdb
Binary file not shown.
Binary file added Postgress/lib32/pgenlista.pdb
Binary file not shown.
Binary file added Postgress/lib32/psqlodbc30a.pdb
Binary file not shown.
Binary file added Postgress/lib32/psqlodbc35w.pdb
Binary file not shown.
Binary file added Postgress/lib64/pgenlist.pdb
Binary file not shown.
Binary file added Postgress/lib64/pgenlista.pdb
Binary file not shown.
Binary file added Postgress/lib64/psqlodbc30a.pdb
Binary file not shown.
Binary file added Postgress/lib64/psqlodbc35w.pdb
Binary file not shown.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
</p>
Geração de classes de entidades. Com opções para o SimpleORM.


Instrunção para Postgres SQL

- Pegue na pasta postgres, a lib que corresponde a versão instalada em sua máquina.
Copie e cole na pasta que o executável Code4DelphiGeraClasses está, renome deixando somente a pasta lib,
pois a aplicação buscará por essa pasta.

## 📞 Contacts

Expand Down
13 changes: 10 additions & 3 deletions Src/Model/DM/Model.DM1.dfm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
object DM: TDM
OldCreateOrder = False
OnCreate = DataModuleCreate
Height = 468
Width = 843
Expand Down Expand Up @@ -74,8 +73,8 @@ object DM: TDM
end
object DS_FDMemTableTabelas: TDataSource
DataSet = FDMemTableTabelas
Left = 328
Top = 80
Left = 464
Top = 216
end
object FDMetaInfoQueryFIelds: TFDMetaInfoQuery
Connection = FDConnection1
Expand Down Expand Up @@ -141,4 +140,12 @@ object DM: TDM
Left = 464
Top = 16
end
object FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink
Left = 464
Top = 88
end
object FDPhysPgDriverLink1: TFDPhysPgDriverLink
Left = 464
Top = 152
end
end
41 changes: 25 additions & 16 deletions Src/Model/DM/Model.DM1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,36 @@
interface

uses
System.Classes,
System.SysUtils,
Data.DB,

FireDAC.Comp.Client,
FireDAC.Comp.DataSet,
FireDAC.Stan.Intf,
FireDAC.Stan.Option,
FireDAC.Stan.Error,
FireDAC.Stan.Def,
FireDAC.Stan.Pool,
FireDAC.Stan.Async,
FireDAC.Stan.Param,
FireDAC.Phys.Intf,
FireDAC.DApt,
FireDAC.DApt.Intf,
FireDAC.DatS,
FireDAC.Phys,
FireDAC.Phys.FB,
FireDAC.Phys.FBDef,
FireDAC.Phys.IBBase,
FireDAC.Phys.Intf,
FireDAC.Phys.MySQL,
FireDAC.Phys.MySQLDef,
FireDAC.Phys.SQLite,
FireDAC.Phys.SQLiteDef,
FireDAC.Phys.SQLiteWrapper.Stat,
FireDAC.Stan.Async,
FireDAC.Stan.Def,
FireDAC.Stan.Error,
FireDAC.Stan.ExprFuncs,
FireDAC.Stan.Intf,
FireDAC.Stan.Option,
FireDAC.Stan.Param,
FireDAC.Stan.Pool,
FireDAC.UI.Intf,
FireDAC.VCLUI.Wait,
FireDAC.DatS,
FireDAC.DApt.Intf,
FireDAC.DApt,
FireDAC.Phys.FBDef,
FireDAC.Phys.IBBase,
FireDAC.Phys.FB;

System.Classes,
System.SysUtils, FireDAC.Phys.PGDef, FireDAC.Phys.PG;

type
TDM = class(TDataModule)
Expand Down Expand Up @@ -57,6 +63,8 @@ TDM = class(TDataModule)
FDMetaInfoQueryFIeldsCOLUMN_SCALE: TIntegerField;
FDMetaInfoQueryFIeldsCOLUMN_LENGTH: TIntegerField;
FDPhysFBDriverLink1: TFDPhysFBDriverLink;
FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink;
FDPhysPgDriverLink1: TFDPhysPgDriverLink;
procedure DataModuleCreate(Sender: TObject);
private

Expand All @@ -75,6 +83,7 @@ implementation

procedure TDM.DataModuleCreate(Sender: TObject);
begin
FDPhysPgDriverLink1.VendorHome := '.\';
FDConnection1.Connected := False;
end;

Expand Down
2 changes: 1 addition & 1 deletion Src/Types/Types.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface

type
{$SCOPEDENUMS ON}
TFormaAcesso = (PropertyDireto, PropertyGetSet, GetSet, FluentInterface);
TFormaAcesso = (PropertyDireto, PropertyGetSet, GetSet, FluentInterface, OrientadoInterface);
TORM = (None, SimpleORM);
{$SCOPEDENUMS OFF}

Expand Down
4 changes: 4 additions & 0 deletions Src/Utils/Utils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class function TUtils.GerarCabecalhoArquivo: string;
begin
Result := '{'+ StringOfChar('*', 78) + '}' + sLineBreak +
'{'+ CompD('Code4D - Gerador de classes: ' + FormatDateTime('dd/mm/yyyy hh:nn:ss', Now), 78) +'}' + sLineBreak +
'{'+ CompD('Contribui��o - Tiago Robson - Delphiando - @Tiagoadvir ' + '', 78) +'}' + sLineBreak +
'{'+ StringOfChar('*', 78) + '}' + sLineBreak;

{Result := '//'+ StringOfChar('*', 78) + sLineBreak +
Expand Down Expand Up @@ -181,6 +182,9 @@ class function TUtils.GetFieldType(ATypeName: string; AExibirMsgSeTipoDesconheci
else if(ATypeName = 'DOUBLE')or(ATypeName = 'FLOAT')or(ATypeName = 'DECIMAL')or(ATypeName = 'NUMERIC')then
Result := C_DOUBLE
else
if(ATypeName = 'DOUBLE PRECISION')or(ATypeName = 'FLOAT')or(ATypeName = 'DECIMAL')or(ATypeName = 'NUMERIC')then
Result := C_DOUBLE
else
begin
Application.MessageBox(PChar('Tipo de dado n�o conhecido: ' + ATypeName + ' (tipo string ser� utilizado)'), 'Tipo desconhecido', MB_OK + MB_ICONEXCLAMATION);
Result := C_STRING+ ' {'+ ATypeName +'}';
Expand Down
71 changes: 60 additions & 11 deletions Src/View/View.Main.dfm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
object ViewMain: TViewMain
object ViewMain: TViewMain
Left = 0
Top = 0
Caption = 'Code4D - Gerador de classes'
Expand All @@ -10,13 +10,11 @@ object ViewMain: TViewMain
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
WindowState = wsMaximized
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object pnRodape: TPanel
Left = 0
Expand All @@ -29,6 +27,8 @@ object ViewMain: TViewMain
Padding.Left = 3
ParentBackground = False
TabOrder = 0
ExplicitTop = 619
ExplicitWidth = 1031
object imgLogo: TImage
Left = 3
Top = 0
Expand Down Expand Up @@ -249,7 +249,6 @@ object ViewMain: TViewMain
ParentFont = False
Layout = tlCenter
OnClick = imgLogoClick
ExplicitLeft = 83
ExplicitWidth = 255
ExplicitHeight = 33
end
Expand All @@ -259,9 +258,11 @@ object ViewMain: TViewMain
Top = 0
Width = 1035
Height = 620
ActivePage = tabConexao
ActivePage = tabGerador
Align = alClient
TabOrder = 1
ExplicitWidth = 1031
ExplicitHeight = 619
object tabConexao: TTabSheet
Caption = 'Conex'#227'o'
object pnConexao: TPanel
Expand Down Expand Up @@ -359,13 +360,13 @@ object ViewMain: TViewMain
Width = 650
Height = 21
Style = csDropDownList
ItemIndex = 0
TabOrder = 0
Text = 'MySQL'
OnChange = cBoxDriverChange
Items.Strings = (
'MySQL'
'Firebird')
'Firebird'
'SQLite'
'Postgres')
end
object edtDatabase: TEdit
Left = 24
Expand Down Expand Up @@ -467,6 +468,26 @@ object ViewMain: TViewMain
Caption = 'Salvar senha para pr'#243'ximos acessos'
TabOrder = 11
end
object btnPreencherComDadosSQLite: TButton
Left = 693
Top = 80
Width = 218
Height = 25
Cursor = crHandPoint
Caption = 'Preencher com dados b'#225'sicos do SQLite'
TabOrder = 12
OnClick = btnPreencherComDadosSQLiteClick
end
object btnPreencherComDadosPostgres: TButton
Left = 693
Top = 111
Width = 218
Height = 25
Cursor = crHandPoint
Caption = 'Preencher com dados b'#225'sicos do Postgres'
TabOrder = 13
OnClick = btnPreencherComDadosPostgresClick
end
end
end
object tabGerador: TTabSheet
Expand All @@ -481,6 +502,8 @@ object ViewMain: TViewMain
BevelOuter = bvNone
ParentBackground = False
TabOrder = 0
ExplicitWidth = 1023
ExplicitHeight = 591
object Splitter1: TSplitter
Left = 297
Top = 0
Expand All @@ -498,6 +521,7 @@ object ViewMain: TViewMain
BevelOuter = bvNone
ParentBackground = False
TabOrder = 0
ExplicitHeight = 591
object Panel6: TPanel
AlignWithMargins = True
Left = 0
Expand Down Expand Up @@ -656,6 +680,8 @@ object ViewMain: TViewMain
BevelOuter = bvNone
ParentBackground = False
TabOrder = 1
ExplicitWidth = 723
ExplicitHeight = 591
object mmLog: TMemo
Left = 0
Top = 297
Expand All @@ -670,6 +696,8 @@ object ViewMain: TViewMain
ParentFont = False
ScrollBars = ssVertical
TabOrder = 0
ExplicitWidth = 723
ExplicitHeight = 261
end
object Panel7: TPanel
Left = 0
Expand All @@ -684,13 +712,15 @@ object ViewMain: TViewMain
BevelOuter = bvNone
ParentBackground = False
TabOrder = 1
ExplicitWidth = 723
object Panel1: TPanel
Left = 0
Top = 0
Width = 727
Height = 59
Align = alTop
TabOrder = 0
ExplicitWidth = 723
object Label8: TLabel
Left = 7
Top = 0
Expand Down Expand Up @@ -725,14 +755,14 @@ object ViewMain: TViewMain
object ckGravarArquivosPasta: TCheckBox
Left = 7
Top = 38
Width = 139
Width = 149
Height = 17
Cursor = crHandPoint
Caption = 'Gravar arquivos na pasta'
TabOrder = 2
end
object ckAbrirPastaAposGravar: TCheckBox
Left = 154
Left = 162
Top = 38
Width = 147
Height = 17
Expand Down Expand Up @@ -787,8 +817,10 @@ object ViewMain: TViewMain
'Property acesso direto'
'Property acesso Get e Set'
'Func'#245'es com prefixo Get e Set'
'Fun'#231#245'es fluent interface (overload)')
'Fun'#231#245'es fluent interface (overload)'
'Orientado a Interfaces')
TabOrder = 1
OnClick = rdGroupFormaAcessoEntitiesClick
end
end
object GroupBox2: TGroupBox
Expand Down Expand Up @@ -893,6 +925,21 @@ object ViewMain: TViewMain
State = cbChecked
TabOrder = 6
end
object ckGerarsaídadedadosinterface: TCheckBox
AlignWithMargins = True
Left = 5
Top = 155
Width = 234
Height = 17
Cursor = crHandPoint
Margins.Top = 0
Align = alTop
Caption = 'Gerar sa'#237'da de dados interface'
TabOrder = 7
Visible = False
ExplicitLeft = 3
ExplicitTop = 167
end
end
object Panel2: TPanel
Left = 468
Expand Down Expand Up @@ -1029,6 +1076,8 @@ object ViewMain: TViewMain
Padding.Bottom = 3
ParentBackground = False
TabOrder = 2
ExplicitTop = 558
ExplicitWidth = 723
object btnLogLimpar: TButton
Left = 3
Top = 3
Expand Down
Loading