From: <sr...@us...> - 2006-12-22 04:28:35
|
Revision: 744 http://svn.sourceforge.net/instantobjects/revision/?rev=744&view=rev Author: srmitch Date: 2006-12-21 20:28:30 -0800 (Thu, 21 Dec 2006) Log Message: ----------- - Update to trunk r743. Modified Paths: -------------- branches/EnsureObjectsDev/Demos/PrimerCross/DemoData.pas branches/EnsureObjectsDev/Demos/PrimerCross/Model/Model.pas branches/EnsureObjectsDev/Demos/PrimerCross/ModelExternal/Model.pas branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.dfm branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.pas branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADO.pas branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.dfm branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.pas branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDE.pas branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDECatalog.pas branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDEConnectionDefEdit.pas branches/EnsureObjectsDev/Source/Brokers/DBX/InstantDBX.pas branches/EnsureObjectsDev/Source/Brokers/IBX/InstantIBX.pas branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDB.pas branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBCatalog.pas branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBEmbeddedConnectionDefEdit.pas branches/EnsureObjectsDev/Source/Brokers/UIB/InstantUIB.pas branches/EnsureObjectsDev/Source/Brokers/XML/InstantXML.pas branches/EnsureObjectsDev/Source/Catalogs/IBFb/InstantIBFbCatalog.pas branches/EnsureObjectsDev/Source/Catalogs/MSSql/InstantMSSqlCatalog.pas branches/EnsureObjectsDev/Source/Core/InstantBrokers.pas branches/EnsureObjectsDev/Source/Core/InstantCode.pas branches/EnsureObjectsDev/Source/Core/InstantMetadata.pas branches/EnsureObjectsDev/Source/Core/InstantPersistence.pas branches/EnsureObjectsDev/Source/Core/InstantPresentation.pas branches/EnsureObjectsDev/Source/Core/InstantTypes.pas branches/EnsureObjectsDev/Source/Design/InstantAttributeEditor.pas branches/EnsureObjectsDev/Source/Design/InstantModelExplorer.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFClassRegWizard.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFClasses.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFCritic.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFDefs.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFExpert.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFNotify.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFOptions.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFReg.pas branches/EnsureObjectsDev/Source/ObjectFoundry/OFUtils.pas branches/EnsureObjectsDev/Tests/TestIO.dpr branches/EnsureObjectsDev/Tests/TestInstantDateTime.pas branches/EnsureObjectsDev/Tests/TestModel.pas Added Paths: ----------- branches/EnsureObjectsDev/Docs/InstantDate-InstantTime Release Notes.txt branches/EnsureObjectsDev/Docs/InterBase_DataTypes.html branches/EnsureObjectsDev/Docs/ObjectFoundry_readme.txt branches/EnsureObjectsDev/Source/ObjectFoundry/ObjectFoundry.inc branches/EnsureObjectsDev/Tests/TestInstantDate.pas branches/EnsureObjectsDev/Tests/TestInstantTime.pas Removed Paths: ------------- branches/EnsureObjectsDev/Source/ObjectFoundry/OF_readme.txt Modified: branches/EnsureObjectsDev/Demos/PrimerCross/DemoData.pas =================================================================== --- branches/EnsureObjectsDev/Demos/PrimerCross/DemoData.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Demos/PrimerCross/DemoData.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -184,6 +184,7 @@ Gender := TGender(Random(2)); Result.Name := RandomFullName(Gender); Result.BirthDate := Date - (20 * 365 + Random(365 * 50)); // 20 - 70 years old + Result.BirthTime := Random; Result.Address := CreateRandomAddress; // Result.Salary := 922337203685470; Result.Salary := 500 + Random(5000); Modified: branches/EnsureObjectsDev/Demos/PrimerCross/Model/Model.pas =================================================================== --- branches/EnsureObjectsDev/Demos/PrimerCross/Model/Model.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Demos/PrimerCross/Model/Model.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -8,7 +8,7 @@ interface uses - InstantPersistence; + InstantPersistence, InstantTypes; type TAddress = class; @@ -21,6 +21,7 @@ TPerson = class; TPhone = class; + TAddress = class(TInstantObject) {IOMETADATA City: String(30) index; Country: Reference(TCountry); @@ -164,25 +165,29 @@ TPerson = class(TContact) {IOMETADATA stored; - BirthDate: DateTime; Emails: Parts(TEmail); Employer: Reference(TCompany); Picture: Graphic; - Salary: Currency; } - _BirthDate: TInstantDateTime; + Salary: Currency; + BirthDate: Date; + BirthTime: Time; } + _BirthDate: TInstantDate; + _BirthTime: TInstantTime; _Emails: TInstantParts; _Employer: TInstantReference; _Picture: TInstantGraphic; _Salary: TInstantCurrency; private - function GetBirthDate: TDateTime; + function GetBirthDate: TDate; + function GetBirthTime: TTime; function GetEmailCount: Integer; function GetEmails(Index: Integer): TEmail; function GetEmployer: TCompany; function GetMainEmailAddress: string; function GetPicture: string; function GetSalary: Currency; - procedure SetBirthDate(Value: TDateTime); + procedure SetBirthDate(Value: TDate); + procedure SetBirthTime(Value: TTime); procedure SetEmails(Index: Integer; Value: TEmail); procedure SetMainEmailAddress(const Value: string); procedure SetPicture(const Value: string); @@ -200,7 +205,8 @@ property EmailCount: Integer read GetEmailCount; property Emails[Index: Integer]: TEmail read GetEmails write SetEmails; published - property BirthDate: TDateTime read GetBirthDate write SetBirthDate; + property BirthDate: TDate read GetBirthDate write SetBirthDate; + property BirthTime: TTime read GetBirthTime write SetBirthTime; property Employer: TCompany read GetEmployer; property MainEmailAddress: string read GetMainEmailAddress write SetMainEmailAddress; property Picture: string read GetPicture write SetPicture; @@ -390,11 +396,16 @@ end; end; -function TPerson.GetBirthDate: TDateTime; +function TPerson.GetBirthDate: TDate; begin Result := _BirthDate.Value; end; +function TPerson.GetBirthTime: TTime; +begin + Result := _BirthTime.Value; +end; + function TPerson.GetEmailCount: Integer; begin Result := _Emails.Count @@ -443,11 +454,16 @@ Result := _Emails.Remove(Email); end; -procedure TPerson.SetBirthDate(Value: TDateTime); +procedure TPerson.SetBirthDate(Value: TDate); begin _BirthDate.Value := Value; end; +procedure TPerson.SetBirthTime(Value: TTime); +begin + _BirthTime.Value := Value; +end; + procedure TPerson.SetEmails(Index: Integer; Value: TEmail); begin _Emails[Index] := Value; Modified: branches/EnsureObjectsDev/Demos/PrimerCross/ModelExternal/Model.pas =================================================================== --- branches/EnsureObjectsDev/Demos/PrimerCross/ModelExternal/Model.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Demos/PrimerCross/ModelExternal/Model.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -8,7 +8,7 @@ interface uses - InstantPersistence; + InstantPersistence, InstantTypes; type TAddress = class; @@ -167,25 +167,29 @@ TPerson = class(TContact) {IOMETADATA stored ensureobjects; - BirthDate: DateTime; Emails: Parts(TEmail) external 'Person_Emails'; Employer: Reference(TCompany); Picture: Graphic; - Salary: Currency; } - _BirthDate: TInstantDateTime; + Salary: Currency; + BirthDate: Date; + BirthTime: Time; } + _BirthDate: TInstantDate; + _BirthTime: TInstantTime; _Emails: TInstantParts; _Employer: TInstantReference; _Picture: TInstantGraphic; _Salary: TInstantCurrency; private - function GetBirthDate: TDateTime; + function GetBirthDate: TDate; + function GetBirthTime: TTime; function GetEmailCount: Integer; function GetEmails(Index: Integer): TEmail; function GetEmployer: TCompany; function GetMainEmailAddress: string; function GetPicture: string; function GetSalary: Currency; - procedure SetBirthDate(Value: TDateTime); + procedure SetBirthDate(Value: TDate); + procedure SetBirthTime(Value: TTime); procedure SetEmails(Index: Integer; Value: TEmail); procedure SetMainEmailAddress(const Value: string); procedure SetPicture(const Value: string); @@ -203,7 +207,8 @@ property EmailCount: Integer read GetEmailCount; property Emails[Index: Integer]: TEmail read GetEmails write SetEmails; published - property BirthDate: TDateTime read GetBirthDate write SetBirthDate; + property BirthDate: TDate read GetBirthDate write SetBirthDate; + property BirthTime: TTime read GetBirthTime write SetBirthTime; property Employer: TCompany read GetEmployer; property MainEmailAddress: string read GetMainEmailAddress write SetMainEmailAddress; property Picture: string read GetPicture write SetPicture; @@ -393,11 +398,16 @@ end; end; -function TPerson.GetBirthDate: TDateTime; +function TPerson.GetBirthDate: TDate; begin Result := _BirthDate.Value; end; +function TPerson.GetBirthTime: TTime; +begin + Result := _BirthTime.Value; +end; + function TPerson.GetEmailCount: Integer; begin Result := _Emails.Count; @@ -446,11 +456,16 @@ Result := _Emails.Remove(Email); end; -procedure TPerson.SetBirthDate(Value: TDateTime); +procedure TPerson.SetBirthDate(Value: TDate); begin _BirthDate.Value := Value; end; +procedure TPerson.SetBirthTime(Value: TTime); +begin + _BirthTime.Value := Value; +end; + procedure TPerson.SetEmails(Index: Integer; Value: TEmail); begin _Emails[Index] := Value; Modified: branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.dfm =================================================================== --- branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.dfm 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.dfm 2006-12-22 04:28:30 UTC (rev 744) @@ -59,7 +59,15 @@ Height = 13 Caption = 'Sa&lary' end - object PicturePanel: TPanel [13] + object Label1: TLabel [13] + Left = 136 + Top = 264 + Width = 44 + Height = 13 + Caption = 'BirthTime' + FocusControl = BirthTimeEdit + end + object PicturePanel: TPanel [14] Left = 332 Top = 203 Width = 76 @@ -95,7 +103,7 @@ Visible = True end> end - object BirthDateEdit: TDBEdit [20] + object BirthDateEdit: TDBEdit [21] Left = 136 Top = 200 Width = 73 @@ -104,7 +112,7 @@ DataSource = SubjectSource TabOrder = 7 end - object EmployerEdit: TDBEdit [21] + object EmployerEdit: TDBEdit [22] Left = 8 Top = 240 Width = 129 @@ -114,7 +122,7 @@ ReadOnly = True TabOrder = 8 end - object EmailsGrid: TDBGrid [22] + object EmailsGrid: TDBGrid [23] Left = 240 Top = 120 Width = 169 @@ -135,7 +143,7 @@ Visible = True end> end - object EmployerToolBar: TToolBar [23] + object EmployerToolBar: TToolBar [24] Left = 140 Top = 237 Width = 69 @@ -175,7 +183,7 @@ OnClick = EmployerClearButtonClick end end - object PictureButton: TButton [24] + object PictureButton: TButton [25] Left = 240 Top = 246 Width = 81 @@ -187,7 +195,7 @@ object SalaryEdit: TDBEdit Left = 8 Top = 280 - Width = 153 + Width = 121 Height = 21 DataField = 'Salary' DataSource = SubjectSource @@ -202,6 +210,15 @@ TabOrder = 15 OnClick = ClearButtonClick end + object BirthTimeEdit: TDBEdit + Left = 136 + Top = 280 + Width = 81 + Height = 21 + DataField = 'BirthTime' + DataSource = SubjectSource + TabOrder = 16 + end end end end Modified: branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.pas =================================================================== --- branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Demos/PrimerCross/PersonEdit.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -41,6 +41,8 @@ PicturePanel: TPanel; PictureImage: TImage; ClearButton: TButton; + Label1: TLabel; + BirthTimeEdit: TDBEdit; procedure EmployerClearButtonClick(Sender: TObject); procedure EmployerEditButtonClick(Sender: TObject); procedure EmployerLookupButtonClick(Sender: TObject); Added: branches/EnsureObjectsDev/Docs/InstantDate-InstantTime Release Notes.txt =================================================================== --- branches/EnsureObjectsDev/Docs/InstantDate-InstantTime Release Notes.txt (rev 0) +++ branches/EnsureObjectsDev/Docs/InstantDate-InstantTime Release Notes.txt 2006-12-22 04:28:30 UTC (rev 744) @@ -0,0 +1,122 @@ +---------- InstantDate InstantTime Release Notes ----------------- +Summary of Changes for Support of InstantDate and InstantTime Data types. + +Requirements +--------------------------------- +1. Must completely rebuild IO. +2. Must add InstantTypes to Interface Uses class of the model unit(s). if you want to use the new datatypes. + +InstantType.pas defines: +TDate = class(TDateTime); +TTime = class(TDateTime); +The Model Explorer has been modified to automatically or (auto-magically) add the Interface uses clause of your model file(s) with InstantType and the Implementation uses clause with InstantMetadata when you edit your model. + +Files affected : +Core Files modified: +--------------------------------- +InstantBrokers.pas +InstantClasses.pas +InstantCode.pas +InstantMetadata.pas +InstantPersistence.pas +InstantPresentation.pas +InstantTypes.pas + + +Tests Files Modified (* new files) +--------------------------------- +* TestInstantDate.pas +TestInstantDateTime.pas +* TestInstantTime.pas +TestIO.dpr +TestIO.mdr +TestModel.pas + +Document files (Docs Directory) +-------------------------------- +* InstantDateInstantTime_Releasenotes.txt (this document) + +Demos - PrimerCross (Birthtime attribute added to TPerson and random Birthtimes are generated) +--------------------------------- +DemoData.pas +PersonEdit.dfm +PersonEdit.pas +Primer.mdr +PrimerExternal.mdr +Model/model.pas +ModelExternal/model.pas + +Brokers (Note: I only modified the files for the standard set of Brokers which are build in RunTimePackages.bpg). +--------------------------------- +InstantADO.pas +InstantBDE.pas +InstantDBX.pas +InstantIBX.pas + +Note: The following brokers will also need to be modified. +InstantADS.pas +InstantDBISAM.pas +InstantFlashFiler.pas +InstantNexusDB.pas +InstantUIB.pas +InstantZeosDBO.pas + +Catalogs +--------------------------------- +InstantBDECatalog.pas +InstantIBFbCatalog.pas +InstantMSSqlCatalog.pas + +Note: (AFIK InstantXML.pas does not need to be modified) + +Note: +All brokers and catalogs must be modified to account for the two new data types. All standard brokers have been modified to map SQL datatypes for Date and Time. The default is to use DATETIME/TIMESTAMP for Date and Time Datatypes in SQL Brokers. The update has made this modification to all of the standard brokers and catalogs, but you should double check to be sure. If you have your own customized broker/catalog or you are using one of the brokers which is not part of the standard build, you will have to make similar changes as shown in the below mapping between SQL Datatypes and InstantDatatypes: + +function TInstantBDECatalog.ColumnTypeToDataType(const ColumnType: TFieldType; + out DataType: TInstantDataType): Boolean; +begin + Result := True; + case ColumnType of + ftString: DataType := dtString; + ftSmallint, + ftInteger: DataType := dtInteger; + ftBoolean: DataType := dtBoolean; + ftFloat: DataType := dtFloat; + ftCurrency: DataType := dtCurrency; + ftDate: DataType := dtDate; // <- Map Date Fields + ftTime: DataType := dtTime; // <-- Map Time Fields + ftDateTime: DataType := dtDateTime; + ftAutoInc: DataType := dtInteger; + ftBlob, + ftGraphic: DataType := dtBlob; + ftMemo: DataType := dtMemo; + else + Result := False; + end; +end; + +function TInstantADOMSSQLBroker.DataTypeToColumnType( + DataType: TInstantDataType; Size: Integer): string; +const + Types: array[TInstantDataType] of string = ( + 'INTEGER', + 'FLOAT', + 'MONEY', + 'BIT', + 'VARCHAR', + 'TEXT', + 'DATETIME', + 'IMAGE', + 'DATETIME', // <- Map Date Fields + 'DATETIME'); // <- Map Time Fields +begin + Result := Types[DataType]; + if (DataType = dtString) and (Size > 0) then + Result := Result + InstantEmbrace(IntToStr(Size), '()'); +end; + +I haved removed the following that were contained in my uploads to the repository ng. + +1. ACR - Accuracer +2. DBX - Support for ASA-SqlAnyWhere (and it's Catalog 'InstantASACatalog.pas') +3. SDAC - Corelab SQL Server Data Access Components Property changes on: branches/EnsureObjectsDev/Docs/InstantDate-InstantTime Release Notes.txt ___________________________________________________________________ Name: svn:eol-style + native Added: branches/EnsureObjectsDev/Docs/InterBase_DataTypes.html =================================================================== --- branches/EnsureObjectsDev/Docs/InterBase_DataTypes.html (rev 0) +++ branches/EnsureObjectsDev/Docs/InterBase_DataTypes.html 2006-12-22 04:28:30 UTC (rev 744) @@ -0,0 +1,802 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> + <TITLE></TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Win32)"> + <META NAME="CREATED" CONTENT="20061127;22314800"> + <META NAME="CHANGED" CONTENT="16010101;12000000"> + <STYLE> + <!-- + @page { size: 29.7cm 21cm; margin-left: 2cm; margin-right: 2cm; margin-top: 1.7cm; margin-bottom: 1.7cm } + P { margin-bottom: 0.21cm; direction: ltr; color: #000000; widows: 0; orphans: 0 } + P.western { font-family: "Times New Roman", serif; font-size: 12pt; so-language: en-US } + P.cjk { font-family: "Arial Unicode MS", sans-serif; font-size: 12pt; so-language: } + P.ctl { font-family: "Tahoma"; font-size: 12pt; so-language: } + TD P { margin-bottom: 0cm; direction: ltr; color: #000000; widows: 0; orphans: 0 } + TD P.western { font-family: "Times New Roman", serif; font-size: 12pt; so-language: en-US } + TD P.cjk { font-family: "Arial Unicode MS", sans-serif; font-size: 12pt; so-language: } + TD P.ctl { font-family: "Tahoma"; font-size: 12pt; so-language: } + --> + </STYLE> +</HEAD> +<BODY LANG="en-US" TEXT="#000000" DIR="LTR"> +<P CLASS="western"><FONT SIZE=4><B>InterBase / Firebird Data Types and Instant +Objects</B></FONT></P> +<TABLE WIDTH=960 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0> + <COL WIDTH=132> + <COL WIDTH=102> + <COL WIDTH=117> + <COL WIDTH=60> + <COL WIDTH=56> + <COL WIDTH=63> + <COL WIDTH=58> + <COL WIDTH=60> + <COL WIDTH=60> + <COL WIDTH=180> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western"><B>IB/Fb Data Type</B></P> + </TD> + <TD WIDTH=102> + <P CLASS="western"><B>RDB$FIELDS definition (1)</B></P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT><B>RDB$TYPES description (2)</B></P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER><B>IB 4</B></P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER><B>IB 5.x</B></P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER><B>IB 6.0</B></P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER><B>IB6.5</B></P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER><B>IB7.x</B></P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER><B>Fb2.0</B></P> + </TD> + <TD WIDTH=180> + <P CLASS="western"><B>Mapped to IO Data Type</B></P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">SMALLINT</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">7</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>SHORT</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Boolean</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">INTEGER</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">8</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>LONG</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Integer</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">QUAD</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">9</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>QUAD</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">n/a</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">FLOAT</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">10</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>FLOAT</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Float</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">D_FLOAT</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">11</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>-</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">n/a</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">DATE (3)</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">12</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>DATE</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Date</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">TIME</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">13</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>TIME</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Time</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">CHAR</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">14</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>TEXT</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">String</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">INT64 (4)</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">16</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>-</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Currency</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">BOOLEAN</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">17</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>-</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">n/a</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">DOUBLE</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">27</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>DOUBLE</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Float</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">TIMESTAMP (3)</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">35</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>TIMESTAMP</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">DateTime</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">VARCHAR</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">37</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>VARYING</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">String</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">CSTRING</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">40</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>CSTRING</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">n/a</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">BLOB_ID</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">45</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>BLOB_ID</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>N</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">n/a</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=132> + <P CLASS="western">BLOB (4)</P> + </TD> + <TD WIDTH=102> + <P CLASS="western">261</P> + </TD> + <TD WIDTH=117> + <P CLASS="western" ALIGN=LEFT>BLOB</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=56> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=63> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=58> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=60> + <P CLASS="western" ALIGN=CENTER>Y</P> + </TD> + <TD WIDTH=180> + <P CLASS="western">Memo or Blob</P> + </TD> + </TR> +</TABLE> +<P CLASS="western" STYLE="margin-bottom: 0cm"><BR> +</P> +<P CLASS="western" STYLE="margin-bottom: 0cm"><B>Notes:</B></P> +<OL> + <LI><P CLASS="western" STYLE="margin-bottom: 0cm">Data Types used in + RDB$FIELDS table to describe column data type</P> + <LI><P CLASS="western" STYLE="margin-bottom: 0cm">Some Data Types + described in RDB$TYPES table, Note there are no entries for data + types 11,16,17 !</P> + <LI><P CLASS="western" STYLE="margin-bottom: 0cm">Type 35 changed + from DATE to TIMESTAMP in version 6.0</P> + <LI><P CLASS="western" STYLE="margin-bottom: 0cm">Sub types defined + for BLOB, CHAR, SMALLINT, INTEGER and INT64.</P> +</OL> +<P CLASS="western" STYLE="margin-bottom: 0cm">See language reference +guide (System Tables chapter) for more information.</P> +<P CLASS="western" STYLE="margin-bottom: 0cm"><BR> +</P> +<P CLASS="western" STYLE="margin-bottom: 0cm"><BR> +</P> +<P CLASS="western" STYLE="margin-bottom: 0cm"><FONT SIZE=4><B>Mapping +of Instant Attributes Types to IB/Fb Data Types (via the Instant Data +Types)</B></FONT></P> +<P CLASS="western" STYLE="margin-bottom: 0cm"><BR> +</P> +<TABLE WIDTH=971 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0> + <COL WIDTH=282> + <COL WIDTH=392> + <COL WIDTH=271> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western"><B>TInstantAttributeType</B></P> + </TD> + <TD WIDTH=392> + <P CLASS="western"><B>TInstantDataType</B></P> + </TD> + <TD WIDTH=271> + <P CLASS="western"><B>Mapping to IB/Fb Data Type</B></P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atUnknown</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtString</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">VARCHAR</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atInteger</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtInteger</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">INTEGER</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atFloat</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtFloat</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">DOUBLE PRECISION</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atCurrency</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtCurrency</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">DECIMAL(14,4)</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atBoolean</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtBoolean</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">SMALLINT'</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atString</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtString</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">VARCHAR</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atDateTime</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtDateTime</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">TIMESTAMP</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atBlob</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtBlob</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">BLOB</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atMemo</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtMemo</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">BLOB SUB_TYPE 1</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atGraphic</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtBlob</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">BLOB</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atPart (embedded only)</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtBlob</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">BLOB</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atReference</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">n/a</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">n/a</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atParts (embedded only)</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtBlob</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">BLOB</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atReferences (embedded only)</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtBlob</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">BLOB</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atDate</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtDate</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">DATE</P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=282> + <P CLASS="western">atTime</P> + </TD> + <TD WIDTH=392> + <P CLASS="western">dtTime</P> + </TD> + <TD WIDTH=271> + <P CLASS="western">TIME'</P> + </TD> + </TR> +</TABLE> +<P CLASS="western" STYLE="margin-bottom: 0cm"><BR> +</P> +</BODY> +</HTML> \ No newline at end of file Added: branches/EnsureObjectsDev/Docs/ObjectFoundry_readme.txt =================================================================== --- branches/EnsureObjectsDev/Docs/ObjectFoundry_readme.txt (rev 0) +++ branches/EnsureObjectsDev/Docs/ObjectFoundry_readme.txt 2006-12-22 04:28:30 UTC (rev 744) @@ -0,0 +1,72 @@ +ObjectFoundry (for IO V2.x) Readme +by Carlo Wolter/Steven Mitchell - 21 Mar 2005 +Revised by Steven Mitchell: 29 Nov 2006 + +Introduction +------------ +This file contains instructions and information for the +Object Foundry (OF) integration between IO version 2 and +ModelMaker(c)[http://www.modelmakertools.com]. + +ModelMaker (MM) is an UML designer integrated with Delphi. +It can be used also for InstantObject design, provided +you place the + OFExpt.dll +expert file in the + $(ProgramFiles)\ModelMakerTools\ModelMaker\x.x\Experts +directory. MM detects and loads it during startup and +"ObjectFoundry enabled" is included on the MM startup splash +screen. It is also listed in the "Plug in expert manager" +dialog launched from the Tools/Expert Manager menu option +in MM. + +Currently MM versions 6 to 9 are supported with OF. + +Compiling +--------- +This DLL can be compiled using the project in this directory. + +Please take note that the project needs to know where the +MM Expert files are. Therefore make sure the subdir + $(ProgramFiles)\ModelMakerTools\ModelMaker\x.x\Experts +is in the project options search path + (ie Project/Options/Directories-Conditionals/SearchPath). +This is required because in the MM experts directory there is +a single file that is needed: + MMToolsApi.PAS +Also ensure that the appropriate compiler defines are entered +in the project options Conditional defines (see table below). +(ie Project/Options/Directories-Conditionals/Conditional defines) + + MM Version Define + ---------- ------ + 6.x [none] + 7.x or 8.x MM7+ + 9.x MM9 + +Note: The MMToolsApi.PAS file is protected by copyright of +ModelMakerTools and cannot be put into CVS. Every legitimate +owner of a MM licence, though, should have no problems in +finding it. + +Notes on Usage +-------------- +To operate correctly, this version of OF expects and +generates the IO Metadata identifier tag in the class +metadata info as follows: +"{IOMETADATA " (without quotes but including trailing space). + +Conversion of IO MM projects that did not have the IO +Metadata identifier tag: +Make sure that the model is up to date then save and close +Modelmaker. Backup the MM project file. Backup any previous +'OFExpt.dll' file and copy the new 'OFExpt.dll' file to the +{$Modelmaker}\Experts folder as indicated above. Re-open +Modelmaker. Re-generating the Delphi code from ModelMaker +should update the model code units to include the new class +metadata identifier tag. + +Feedback +-------- +Please report any problems to the IO news support group at +"news.instantobjects.org/instantobjects.org.support". Property changes on: branches/EnsureObjectsDev/Docs/ObjectFoundry_readme.txt ___________________________________________________________________ Name: svn:eol-style + native Modified: branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADO.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADO.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADO.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -107,9 +107,12 @@ function GetDataSet: TCustomADODataSet; protected function CreateDataSet: TDataSet; override; + function CreateNavigationalLinkResolver(const ATableName: string): + TInstantNavigationalLinkResolver; override; function Find(const AClassName, AObjectId: string): Boolean; function Locate(const AClassName, AObjectId: string): Boolean; override; public + function FormatTableName(const ATableName: string): string; virtual; property Broker: TInstantADOBroker read GetBroker; property DataSet: TCustomADODataSet read GetDataSet; end; @@ -148,6 +151,23 @@ property Connector: TInstantADOConnector read GetConnector; end; + TInstantADOLinkResolver = class(TInstantNavigationalLinkResolver) + private + function GetBroker: TInstantADOBroker; + function GetDataSet: TADODataSet; + function GetResolver: TInstantADOResolver; + protected + function CreateDataSet: TDataSet; override; + procedure SetDatasetParentRange(const AParentClass, AParentId: string); + override; + public + constructor Create(AResolver: TInstantNavigationalResolver; const ATableName: + string); + property Broker: TInstantADOBroker read GetBroker; + property DataSet: TADODataSet read GetDataSet; + property Resolver: TInstantADOResolver read GetResolver; + end; + { MS Jet } TInstantADOMSJetBroker = class(TInstantADOBroker) @@ -331,7 +351,9 @@ (adVarChar, adVarWChar, adVarChar, adVarChar, adVarChar, adVarChar), // dtString (adLongVarChar, adLongVarWChar, adLongVarChar, adVarBinary, adLongVarChar, adLongVarChar), // dtMemo (adDate, adDate, adDBTimeStamp, adDBTimeStamp, adDate, adDate), // dtDateTime - (adLongVarBinary, adLongVarBinary, adLongVarBinary, adVarBinary, adLongVarBinary, adLongVarBinary) // dtBlob + (adLongVarBinary, adLongVarBinary, adLongVarBinary, adVarBinary, adLongVarBinary, adLongVarBinary), // dtBlob + (adDate, adDate, adDBTimeStamp, adDBTimeStamp, adDate, adDate), // dtDate + (adDate, adDate, adDBTimeStamp, adDBTimeStamp, adDate, adDate) // dtTime ); var Column: _Column; @@ -447,7 +469,9 @@ 'VARCHAR', 'MEMO', 'DATETIME', - 'BLOB' + 'BLOB', + 'DATE', + 'TIME' ); begin Result := Types[DataType]; @@ -467,6 +491,8 @@ Result := 'TEXT'; dtBlob: Result := 'IMAGE'; + dtDate, dtDateTime: + Result := 'DATETIME'; end; ptOracle: case DataType of @@ -474,7 +500,7 @@ Result := 'CHAR(1)'; dtCurrency: Result := 'DECIMAL(14,4)'; - dtDateTime: + dtDateTime, dtDate, dtTime: Result := 'DATE'; dtBlob: Result := 'BLOB'; @@ -485,7 +511,7 @@ case DataType of dtCurrency: Result := 'DECIMAL(14,4)'; - dtDateTime: + dtDateTime, dtDate, dtTime: Result := 'TIMESTAMP'; dtBlob: Result := 'BLOB (1000 K)'; @@ -795,6 +821,12 @@ end; end; +function TInstantADOResolver.CreateNavigationalLinkResolver( + const ATableName: string): TInstantNavigationalLinkResolver; +begin + Result := TInstantADOLinkResolver.Create(Self, ATableName); +end; + function TInstantADOResolver.Find(const AClassName, AObjectId: string): Boolean; var @@ -837,6 +869,12 @@ end; end; +function TInstantADOResolver.FormatTableName( + const ATableName: string): string; +begin + Result := TableName; +end; + function TInstantADOResolver.GetBroker: TInstantADOBroker; begin Result := inherited Broker as TInstantADOBroker; @@ -1144,7 +1182,9 @@ 'VARCHAR', 'TEXT', 'DATETIME', - 'IMAGE'); + 'IMAGE', + 'DATETIME', + 'DATETIME'); begin Result := Types[DataType]; if (DataType = dtString) and (Size > 0) then @@ -1176,6 +1216,50 @@ { TInstantADOMSSQLQuery } +{ TInstantADOLinkResolver } + +constructor TInstantADOLinkResolver.Create( + AResolver: TInstantNavigationalResolver; const ATableName: string); +begin + inherited Create(AResolver, ATableName); +end; + +function TInstantADOLinkResolver.CreateDataSet: TDataSet; +begin + Result:= TADOTable.Create(nil); + with TADOTable(Result) do + try + Connection := Broker.Connector.Connection; + TableName := Self.TableName; + IndexFieldNames := InstantParentClassFieldName + ';' + + InstantParentIdFieldName; + except + Result.Free; + raise; + end; +end; + +function TInstantADOLinkResolver.GetBroker: TInstantADOBroker; +begin + Result := inherited Broker as TInstantADOBroker; +end; + +function TInstantADOLinkResolver.GetDataSet: TADODataSet; +begin + Result := inherited DataSet as TADODataSet; +end; + +function TInstantADOLinkResolver.GetResolver: TInstantADOResolver; +begin + Result := inherited Resolver as TInstantADOResolver; +end; + +procedure TInstantADOLinkResolver.SetDatasetParentRange(const AParentClass, + AParentId: string); +begin +// Dataset.SetRange([AParentClass, AParentId], [AParentClass, AParentId]); +end; + initialization RegisterClass(TInstantADOConnectionDef); TInstantADOConnector.RegisterClass; Modified: branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.dfm =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.dfm 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.dfm 2006-12-22 04:28:30 UTC (rev 744) @@ -4,7 +4,7 @@ BorderStyle = bsDialog Caption = 'ADO Connection' ClientHeight = 242 - ClientWidth = 362 + ClientWidth = 446 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -19,7 +19,7 @@ object BottomBevel: TBevel Left = 0 Top = 205 - Width = 362 + Width = 446 Height = 2 Align = alBottom Shape = bsBottomLine @@ -27,7 +27,7 @@ object ClientPanel: TPanel Left = 0 Top = 0 - Width = 362 + Width = 446 Height = 205 Align = alClient BevelOuter = bvNone @@ -40,6 +40,22 @@ Caption = 'Blob &format' FocusControl = StreamFormatComboBox end + object Label1: TLabel + Left = 134 + Top = 152 + Width = 62 + Height = 13 + Caption = 'Id Data Type' + FocusControl = IdDataTypeComboBox + end + object Label2: TLabel + Left = 259 + Top = 152 + Width = 32 + Height = 13 + Caption = 'Id Size' + FocusControl = IdDataTypeComboBox + end object DataLinkRadioButton: TRadioButton Left = 16 Top = 16 @@ -97,7 +113,7 @@ object StreamFormatComboBox: TComboBox Left = 32 Top = 168 - Width = 145 + Width = 97 Height = 21 Style = csDropDownList ItemHeight = 13 @@ -112,17 +128,33 @@ Caption = '&Login Prompt' TabOrder = 6 end + object IdDataTypeComboBox: TComboBox + Left = 134 + Top = 168 + Width = 120 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 8 + end + object IdSizeEdit: TEdit + Left = 259 + Top = 168 + Width = 42 + Height = 21 + TabOrder = 9 + end end object BottomPanel: TPanel Left = 0 Top = 207 - Width = 362 + Width = 446 Height = 35 Align = alBottom BevelOuter = bvNone TabOrder = 1 object OkButton: TButton - Left = 204 + Left = 288 Top = 6 Width = 75 Height = 25 @@ -133,7 +165,7 @@ TabOrder = 0 end object CancelButton: TButton - Left = 284 + Left = 368 Top = 6 Width = 75 Height = 25 Modified: branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/ADO/InstantADOConnectionDefEdit.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -24,8 +24,8 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Carlo Barazzetta: blob streaming in XML format (Part, Parts, References) - * Carlo Barazzetta: Currency and LoginPrompt support + * Carlo Barazzetta, Nando Dessena + * * ***** END LICENSE BLOCK ***** *) unit InstantADOConnectionDefEdit; @@ -52,6 +52,10 @@ StreamFormatLabel: TLabel; StreamFormatComboBox: TComboBox; LoginPromptCheckBox: TCheckBox; + Label1: TLabel; + IdDataTypeComboBox: TComboBox; + Label2: TLabel; + IdSizeEdit: TEdit; procedure ConnectionStringButtonClick(Sender: TObject); procedure DataLinkButtonClick(Sender: TObject); procedure DataChanged(Sender: TObject); @@ -67,10 +71,10 @@ implementation -{$R *.DFM} +{$R *.dfm} uses - ADODB, InstantPersistence, InstantClasses; + ADODB, InstantPersistence, InstantClasses, InstantTypes, InstantConsts; { TInstantADOConnDefEditForm } @@ -94,7 +98,10 @@ procedure TInstantADOConnectionDefEditForm.FormCreate(Sender: TObject); begin - AssignInstantStreamFormat(StreamFormatComboBox.Items); //CB + AssignInstantStreamFormat(StreamFormatComboBox.Items); + AssignInstantDataTypeStrings(IdDataTypeComboBox.Items); + IdDataTypeComboBox.ItemIndex := Ord(dtString); + IdSizeEdit.Text := IntToStr(InstantDefaultFieldSize); UpdateControls; end; @@ -121,9 +128,10 @@ DataLinkRadioButton.Checked := True; DataLinkEdit.Text := LinkFileName; end; - //CB StreamFormatComboBox.ItemIndex := Ord(BlobStreamFormat); LoginPromptCheckBox.Checked := LoginPrompt; + IdDataTypeComboBox.ItemIndex := Ord(IdDataType); + IdSizeEdit.Text := IntToStr(IdSize); end; end; @@ -136,9 +144,10 @@ ConnectionString := 'FILE NAME=' + DataLinkEdit.Text else ConnectionString := ConnectionStringEdit.Text; - //CB BlobStreamFormat := TInstantStreamFormat(StreamFormatComboBox.ItemIndex); LoginPrompt := LoginPromptCheckBox.Checked; + IdDataType := TInstantDataType(IdDataTypeComboBox.ItemIndex); + IdSize := StrToInt(IdSizeEdit.Text); end; end; Modified: branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDE.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDE.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDE.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -405,7 +405,7 @@ procedure CreateTable(TableMetadata: TInstantTableMetadata); const FieldTypes: array[TInstantDataType] of TFieldType = - (ftInteger, ftFloat, ftBCD, ftBoolean, ftString, ftMemo, ftDateTime, ftBlob); + (ftInteger, ftFloat, ftBCD, ftBoolean, ftString, ftMemo, ftDateTime, ftBlob, ftDate, ftTime); var I: Integer; Table: TTable; @@ -758,7 +758,7 @@ procedure TInstantDBBuildBDEAddTableCommand.InternalExecute; const FieldTypes: array[TInstantDataType] of TFieldType = - (ftInteger, ftFloat, ftCurrency, ftBoolean, ftString, ftMemo, ftDateTime, ftBlob); + (ftInteger, ftFloat, ftCurrency, ftBoolean, ftString, ftMemo, ftDateTime, ftBlob, ftDate, ftTime); var I: Integer; Table: TTable; Modified: branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDECatalog.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDECatalog.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDECatalog.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -171,8 +171,8 @@ ftBoolean: DataType := dtBoolean; ftFloat: DataType := dtFloat; ftCurrency: DataType := dtCurrency; - ftDate, - ftTime, + ftDate: DataType := dtDate; + ftTime: DataType := dtTime; ftDateTime: DataType := dtDateTime; ftAutoInc: DataType := dtInteger; ftBlob, Modified: branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDEConnectionDefEdit.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDEConnectionDefEdit.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/BDE/InstantBDEConnectionDefEdit.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -181,9 +181,11 @@ with DriverComboBox do ItemIndex := Items.IndexOf(DriverName); end; - //CB StreamFormatComboBox.ItemIndex := Ord(BlobStreamFormat); LoginPromptCheckBox.Checked := LoginPrompt; + IdDataTypeComboBox.ItemIndex := Ord(IdDataType); + IdSizeEdit.Text := IntToStr(IdSize); + UpdateControls; ParametersEdit.Text := Parameters; end; Modified: branches/EnsureObjectsDev/Source/Brokers/DBX/InstantDBX.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/DBX/InstantDBX.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/DBX/InstantDBX.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -160,6 +160,14 @@ { MS SQL Server } + TInstantDBXMSSQLSQLGenerator = class(TInstantSQLGenerator) + protected + function InternalGenerateAlterFieldSQL(OldMetadata, NewMetadata: TInstantFieldMetadata): string; override; + function InternalGenerateDropFieldSQL(Metadata: TInstantFieldMetadata): string; override; + function InternalGenerateDropIndexSQL(Metadata: TInstantIndexMetadata): string; override; + function EmbraceIndex(const IndexName: string): string; virtual; + end; + TInstantDBXMSSQLBroker = class(TInstantDBXBroker) protected function CreateCatalog(const AScheme: TInstantScheme): TInstantCatalog; override; @@ -169,6 +177,8 @@ function GetDBMSName: string; override; function GetSQLQuote: Char; override; function InternalCreateQuery: TInstantQuery; override; + public + class function GeneratorClass: TInstantSQLGeneratorClass; override; end; TInstantDBXMSSQLResolver = class(TInstantSQLResolver) @@ -522,7 +532,9 @@ 'VARCHAR', 'BLOB SUB_TYPE 1', 'TIMESTAMP', - 'BLOB'); + 'BLOB', + 'TIMESTAMP', + 'TIMESTAMP'); begin Result := Types[DataType]; end; @@ -564,7 +576,9 @@ 'VARCHAR', 'TEXT', 'DATETIME', - 'IMAGE'); + 'IMAGE', + 'DATETIME', + 'DATETIME'); begin Result := Types[DataType]; end; @@ -581,6 +595,11 @@ Result := TInstantDBXMSSQLResolver.Create(Self, Map); end; +class function TInstantDBXMSSQLBroker.GeneratorClass: TInstantSQLGeneratorClass; +begin + Result := TInstantDBXMSSQLSQLGenerator; +end; + function TInstantDBXMSSQLBroker.GetDBMSName: string; begin Result := 'MS SQL Server'; @@ -596,6 +615,39 @@ Result := TInstantDBXMSSQLQuery.Create(Connector); end; +{ TInstantDBXMSSQLSQLGenerator } + +function TInstantDBXMSSQLSQLGenerator.EmbraceIndex( + const IndexName: string): string; +begin + Result := InstantEmbrace(IndexName, Delimiters); +end; + +function TInstantDBXMSSQLSQLGenerator.InternalGenerateAlterFieldSQL( + OldMetadata, NewMetadata: TInstantFieldMetadata): string; +begin + Result := Format('ALTER TABLE %s ALTER COLUMN %s %s', + [EmbraceTable(OldMetadata.TableMetadata.Name), + EmbraceField(OldMetadata.Name), + Broker.DataTypeToColumnType(NewMetadata.DataType, NewMetadata.Size)]); +end; + +function TInstantDBXMSSQLSQLGenerator.InternalGenerateDropFieldSQL( + Metadata: TInstantFieldMetadata): string; +begin + Result := Format('ALTER TABLE %s DROP COLUMN %s', + [EmbraceTable(Metadata.TableMetadata.Name), + EmbraceField(Metadata.Name)]); +end; + +function TInstantDBXMSSQLSQLGenerator.InternalGenerateDropIndexSQL( + Metadata: TInstantIndexMetadata): string; +begin + Result := Format('DROP INDEX %s.%s', + [EmbraceTable(Metadata.TableMetadata.Name), + EmbraceIndex(Metadata.Name)]); +end; + { TInstantDBXOracleBroker } procedure TInstantDBXOracleBroker.AssignParam(SourceParam, TargetParam: TParam); @@ -621,7 +673,9 @@ 'VARCHAR', 'CLOB', 'DATE', - 'BLOB'); + 'BLOB', + 'DATE', + 'DATE'); begin Result := Types[DataType]; end; @@ -649,7 +703,9 @@ 'VARCHAR', 'CLOB (1000 K)', 'TIMESTAMP', - 'BLOB (1000 K)'); + 'BLOB (1000 K)', + 'TIMESTAMP', + 'TIMESTAMP'); begin Result := Types[DataType]; end; @@ -690,7 +746,9 @@ 'VARCHAR', 'TEXT', 'DATETIME', - 'BLOB'); + 'BLOB', + 'DATE', + 'TIME'); begin Result := Types[DataType]; end; Modified: branches/EnsureObjectsDev/Source/Brokers/IBX/InstantIBX.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/IBX/InstantIBX.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/IBX/InstantIBX.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -426,7 +426,9 @@ 'VARCHAR', 'BLOB SUB_TYPE 1', 'TIMESTAMP', - 'BLOB'); + 'BLOB', + 'DATE', + 'TIME'); begin Result := Types[DataType]; if (DataType = dtString) and (Size > 0) then Modified: branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDB.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDB.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDB.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -793,7 +793,9 @@ 'VARCHAR', 'TEXT', 'DATETIME', - 'BLOB'); + 'BLOB', + 'DATE', + 'TIME'); begin Result := Types[DataType]; if (DataType = dtString) and (Size > 0) then @@ -824,7 +826,7 @@ Result := TInstantNexusDBSQLGenerator; end; -{ TInstantNexusDBSQLTranslator } +{ TInstantNexusDBTranslator } function TInstantNexusDBTranslator.GetDelimiters: string; begin Modified: branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBCatalog.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBCatalog.pas 2006-12-18 02:19:20 UTC (rev 743) +++ branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBCatalog.pas 2006-12-22 04:28:30 UTC (rev 744) @@ -239,10 +239,12 @@ DataType := dtCurrency else if SameText(ColumnType, 'Boolean') then DataType := dtBoolean - else if SameText(ColumnType, 'DateTime') - or SameText(ColumnType, 'Date') - or SameText(ColumnType, 'Time')then + else if SameText(ColumnType, 'DateTime') then DataType := dtDateTime + else if SameText(ColumnType, 'DATE') then + DataType := dtDate + else if SameText(ColumnType, 'TIME')then + DataType := dtTime else if SameText(ColumnType, 'BLOB') then DataType := dtBlob else if SameText(ColumnType, 'BLOB Memo') then @@ -264,10 +266,12 @@ DataType := dtCurrency else if SameText(ColumnType, 'nxtBoolean') then DataType := dtBoolean - else if SameText(ColumnType, 'nxtDateTime') - or SameText(ColumnType, 'nxtDate') - or SameText(ColumnType, 'nxtTime')then + else if SameText(ColumnType, 'nxtDateTime') then DataType := dtDateTime + else if SameText(ColumnType, 'nxtDate') then + DataType := dtDate + else if SameText(ColumnType, 'nxtTime')then + DataType := dtTime else if SameText(ColumnType, 'nxtBlob') then DataType := dtBlob else if SameText(ColumnType, 'nxtBlobMemo') then Modified: branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBEmbeddedConnectionDefEdit.pas =================================================================== --- branches/EnsureObjectsDev/Source/Brokers/NexusDb/InstantNexusDBEmb... [truncated message content] |