You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(25) |
Oct
(10) |
Nov
(19) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(206) |
Mar
(43) |
Apr
(25) |
May
(20) |
Jun
(69) |
Jul
(121) |
Aug
(95) |
Sep
(122) |
Oct
(213) |
Nov
(46) |
Dec
(39) |
2006 |
Jan
(28) |
Feb
(57) |
Mar
(21) |
Apr
(7) |
May
(11) |
Jun
(2) |
Jul
(8) |
Aug
(13) |
Sep
(2) |
Oct
(2) |
Nov
(20) |
Dec
(16) |
2007 |
Jan
(9) |
Feb
(15) |
Mar
|
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(9) |
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(8) |
Apr
(1) |
May
|
Jun
|
Jul
(11) |
Aug
(57) |
Sep
(2) |
Oct
(6) |
Nov
|
Dec
(7) |
2010 |
Jan
(11) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(27) |
Oct
(3) |
Nov
(7) |
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(10) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(1) |
2013 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(4) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(4) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Steven M. <sr...@us...> - 2005-10-19 01:20:45
|
Update of /cvsroot/instantobjects/Demos/Intro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv439 Modified Files: Main.pas Log Message: Fixed for memory leak when using SQL brokers. Updated to reflect change in object ownership behaviour of TInstantNavigationalResolver, which was made consistent with TInstantSQLResolver. Adding or inserting objects to an InstantSelector now behaves consistently for Navigational and SQL based brokers. Index: Main.pas =================================================================== RCS file: /cvsroot/instantobjects/Demos/Intro/Main.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.pas 2 Feb 2004 20:55:16 -0000 1.1 --- Main.pas 19 Oct 2005 01:20:37 -0000 1.2 *************** *** 64,71 **** begin Person := TPerson.Create; ! if EditContact(Person) then ! ContactSelector.AddObject(Person) ! else Person.Free; end; --- 64,73 ---- begin Person := TPerson.Create; ! try ! if EditContact(Person) then ! ContactSelector.AddObject(Person); ! finally Person.Free; + end; end; *************** *** 75,82 **** begin Company := TCompany.Create; ! if EditContact(Company) then ! ContactSelector.AddObject(Company) ! else Company.Free; end; --- 77,86 ---- begin Company := TCompany.Create; ! try ! if EditContact(Company) then ! ContactSelector.AddObject(Company); ! finally Company.Free; + end; end; |
From: Steven M. <sr...@us...> - 2005-10-19 01:12:44
|
Update of /cvsroot/instantobjects/Demos/Intro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30695 Modified Files: Model.pas Log Message: Added missing forward class references. Index: Model.pas =================================================================== RCS file: /cvsroot/instantobjects/Demos/Intro/Model.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Model.pas 1 Mar 2005 05:37:11 -0000 1.3 --- Model.pas 19 Oct 2005 01:12:35 -0000 1.4 *************** *** 7,10 **** --- 7,16 ---- type + TAddress = class; + TCompany = class; + TContact = class; + TPerson = class; + TPhone = class; + TAddress = class(TInstantObject) {IOMETADATA City: String(30); |
From: Joao M. <jcm...@us...> - 2005-10-18 22:55:29
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30445/Brokers/ZeosDBO/D5 Modified Files: DclIOZeosDBO_D5.dpk IOZeosDBO_D5.dpk Log Message: Implemented ZeosDBO catalog, finished support for all databases, fixed packages for new catalog implementation, broker improvements. Index: IOZeosDBO_D5.dpk =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D5/IOZeosDBO_D5.dpk,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IOZeosDBO_D5.dpk 5 Oct 2005 03:22:22 -0000 1.2 --- IOZeosDBO_D5.dpk 18 Oct 2005 22:55:17 -0000 1.3 *************** *** 1,5 **** package IOZeosDBO_D5; ! {$R *.RES} {$ALIGN ON} {$ASSERTIONS ON} --- 1,6 ---- package IOZeosDBO_D5; ! {$I '..\..\..\InstantVersion.inc'} ! {$ALIGN ON} {$ASSERTIONS ON} *************** *** 32,40 **** contains ! InstantIBFbCatalog in '..\..\..\Catalogs\IBFb\InstantIBFbCatalog.pas', ! InstantMSSqlCatalog in '..\..\..\Catalogs\MSSql\InstantMSSqlCatalog.pas', ! InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}, ! InstantZeosDBO in '..\InstantZeosDBO.pas'; end. - --- 33,39 ---- contains ! InstantZeosDBO in '..\InstantZeosDBO.pas', ! InstantZeosDBOCatalog in '..\InstantZeosDBOCatalog.pas', ! InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}; end. Index: DclIOZeosDBO_D5.dpk =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D5/DclIOZeosDBO_D5.dpk,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DclIOZeosDBO_D5.dpk 5 Oct 2005 03:22:22 -0000 1.2 --- DclIOZeosDBO_D5.dpk 18 Oct 2005 22:55:17 -0000 1.3 *************** *** 36,38 **** end. - --- 36,37 ---- |
From: Joao M. <jcm...@us...> - 2005-10-18 22:55:28
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D7 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30445/Brokers/ZeosDBO/D7 Modified Files: IOZeosDBO.dpk Log Message: Implemented ZeosDBO catalog, finished support for all databases, fixed packages for new catalog implementation, broker improvements. Index: IOZeosDBO.dpk =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D7/IOZeosDBO.dpk,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IOZeosDBO.dpk 16 Oct 2005 18:57:42 -0000 1.2 --- IOZeosDBO.dpk 18 Oct 2005 22:55:17 -0000 1.3 *************** *** 31,42 **** requires IOCore, ! ZComponent, ! IOIBFbCatalog, ! IOMSSqlCatalog; contains ! InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}, ! InstantZeosDBO in '..\InstantZeosDBO.pas'; end. - --- 31,40 ---- requires IOCore, ! ZComponent; contains ! InstantZeosDBO in '..\InstantZeosDBO.pas', ! InstantZeosDBOCatalog in '..\InstantZeosDBOCatalog.pas', ! InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}; end. |
From: Joao M. <jcm...@us...> - 2005-10-18 22:55:28
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30445/Brokers/ZeosDBO Modified Files: InstantZeosDBO.pas InstantZeosDBOConnectionDefEdit.dfm InstantZeosDBOConnectionDefEdit.pas Added Files: InstantZeosDBOCatalog.pas Log Message: Implemented ZeosDBO catalog, finished support for all databases, fixed packages for new catalog implementation, broker improvements. Index: InstantZeosDBOConnectionDefEdit.dfm =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/InstantZeosDBOConnectionDefEdit.dfm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InstantZeosDBOConnectionDefEdit.dfm 2 Oct 2005 01:53:02 -0000 1.1 --- InstantZeosDBOConnectionDefEdit.dfm 18 Oct 2005 22:55:18 -0000 1.2 *************** *** 4,8 **** BorderStyle = bsDialog Caption = 'ZeosDBO Connection' ! ClientHeight = 343 ClientWidth = 372 Color = clBtnFace --- 4,8 ---- BorderStyle = bsDialog Caption = 'ZeosDBO Connection' ! ClientHeight = 345 ClientWidth = 372 Color = clBtnFace *************** *** 19,23 **** object BottomBevel: TBevel Left = 0 ! Top = 306 Width = 372 Height = 2 --- 19,23 ---- object BottomBevel: TBevel Left = 0 ! Top = 308 Width = 372 Height = 2 *************** *** 29,33 **** Top = 0 Width = 372 ! Height = 306 Align = alClient BevelOuter = bvNone --- 29,33 ---- Top = 0 Width = 372 ! Height = 308 Align = alClient BevelOuter = bvNone *************** *** 65,68 **** --- 65,76 ---- FocusControl = DatabaseEdit end + object CatalogLabel: TLabel + Left = 240 + Top = 56 + Width = 36 + Height = 13 + Caption = '&Catalog' + FocusControl = CatalogEdit + end object UserNameLabel: TLabel Left = 16 *************** *** 140,149 **** Left = 16 Top = 72 ! Width = 305 Height = 21 TabOrder = 3 end object DatabaseButton: TButton ! Left = 330 Top = 72 Width = 21 --- 148,164 ---- Left = 16 Top = 72 ! Width = 193 Height = 21 TabOrder = 3 end + object CatalogEdit: TEdit + Left = 240 + Top = 72 + Width = 113 + Height = 21 + TabOrder = 5 + end object DatabaseButton: TButton ! Left = 214 Top = 72 Width = 21 *************** *** 157,161 **** Width = 145 Height = 21 ! TabOrder = 5 end object PasswordEdit: TEdit --- 172,176 ---- Width = 145 Height = 21 ! TabOrder = 6 end object PasswordEdit: TEdit *************** *** 165,169 **** Height = 21 PasswordChar = '*' ! TabOrder = 6 end object LoginPromptCheckBox: TCheckBox --- 180,184 ---- Height = 21 PasswordChar = '*' ! TabOrder = 7 end object LoginPromptCheckBox: TCheckBox *************** *** 173,177 **** Height = 17 Caption = '&Login Prompt' ! TabOrder = 7 end object PropertiesEditor: TMemo --- 188,192 ---- Height = 17 Caption = '&Login Prompt' ! TabOrder = 8 end object PropertiesEditor: TMemo *************** *** 180,184 **** Width = 185 Height = 129 ! TabOrder = 8 end object StreamFormatComboBox: TComboBox --- 195,199 ---- Width = 185 Height = 129 ! TabOrder = 9 end object StreamFormatComboBox: TComboBox *************** *** 190,194 **** ItemHeight = 13 Sorted = True ! TabOrder = 9 end object IdDataTypeComboBox: TComboBox --- 205,209 ---- ItemHeight = 13 Sorted = True ! TabOrder = 10 end object IdDataTypeComboBox: TComboBox *************** *** 199,203 **** Style = csDropDownList ItemHeight = 13 ! TabOrder = 10 end object IdSizeEdit: TEdit --- 214,218 ---- Style = csDropDownList ItemHeight = 13 ! TabOrder = 11 end object IdSizeEdit: TEdit *************** *** 206,210 **** Width = 65 Height = 21 ! TabOrder = 11 end object UseDelimitedIdentsCheckBox: TCheckBox --- 221,225 ---- Width = 65 Height = 21 ! TabOrder = 12 end object UseDelimitedIdentsCheckBox: TCheckBox *************** *** 214,223 **** Height = 17 Caption = '&Use delimited identifiers' ! TabOrder = 12 end end object BottomPanel: TPanel Left = 0 ! Top = 308 Width = 372 Height = 35 --- 229,238 ---- Height = 17 Caption = '&Use delimited identifiers' ! TabOrder = 13 end end object BottomPanel: TPanel Left = 0 ! Top = 310 Width = 372 Height = 35 --- NEW FILE: InstantZeosDBOCatalog.pas --- (* * InstantObjects DBEvolver Support * ZeosDBO Catalog *) (* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is: InstantObjects DBEvolver Support/ZeosDBO Catalog * * The Initial Developer of the Original Code is: Enrique Esquivel * * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * ***** END LICENSE BLOCK ***** *) unit InstantZeosDBOCatalog; {$IFDEF LINUX} {$I '../../InstantDefines.inc'} {$ELSE} {$I '..\..\InstantDefines.inc'} {$ENDIF} interface uses InstantPersistence, DB, ZDbcIntfs; type // A TInstantCatalog that reads catalog information from a ZeosDBO // database. Can be used with a BDE broker. TInstantZeosDBOCatalog = class(TInstantBrokerCatalog) private procedure AddFieldMetadatas(TableMetadata: TInstantTableMetadata); procedure AddIndexMetadatas(TableMetadata: TInstantTableMetadata); procedure AddTableMetadatas(TableMetadatas: TInstantTableMetadatas); function ColumnTypeToDataType(const ColumnType: TZSQLType; out AlternateDataTypes: TInstantDataTypes): TInstantDataType; public procedure InitTableMetadatas(ATableMetadatas: TInstantTableMetadatas); override; end; implementation uses SysUtils, Classes, ZConnection, InstantConsts, InstantZeosDBO, TypInfo; procedure TInstantZeosDBOCatalog.AddFieldMetadatas( TableMetadata: TInstantTableMetadata); var Fields: IZResultSet; FieldMetadata: TInstantFieldMetadata; AlternateDatatypes: TInstantDataTypes; begin with Broker as TInstantZeosDBOBroker, Connector.Connection as TZConnection do Fields := DbcConnection.GetMetadata.GetColumns(Catalog, '', TableMetadata.Name, ''); Fields.First; while not Fields.IsAfterLast do begin FieldMetadata := TableMetadata.FieldMetadatas.Add; FieldMetadata.Name := Fields.GetStringByName('COLUMN_NAME'); FieldMetadata.DataType := ColumnTypeToDataType(TZSQLType(Fields.GetShortByName('DATA_TYPE')), AlternateDataTypes); FieldMetadata.AlternateDataTypes := AlternateDataTypes; FieldMetadata.Options := []; if Fields.GetBooleanByName('IS_NULLABLE') then FieldMetadata.Options := FieldMetadata.Options + [foRequired]; if TableMetadata.IndexMetadatas.IsFieldIndexed(FieldMetadata) then FieldMetadata.Options := FieldMetadata.Options + [foIndexed]; //work around bug in GetColumns for all drivers where CHAR_OCTET_LENGTH is not assigned if (FieldMetadata.DataType in [dtString, dtMemo]) and (Fields.GetIntByName('CHAR_OCTET_LENGTH') > 0) then FieldMetadata.Size := Fields.GetIntByName('CHAR_OCTET_LENGTH') else FieldMetadata.Size := Fields.GetIntByName('COLUMN_SIZE'); Fields.Next; end; end; procedure TInstantZeosDBOCatalog.AddIndexMetadatas( TableMetadata: TInstantTableMetadata); var IndexName: string; PrimaryKeys: IZResultSet; IndexInfo: IZResultSet; IndexMetadata: TInstantIndexMetadata; begin with Broker as TInstantZeosDBOBroker, Connector.Connection as TZConnection do PrimaryKeys := DbcConnection.GetMetadata.GetPrimaryKeys(Catalog, '', TableMetadata.Name); PrimaryKeys.First; while not PrimaryKeys.IsAfterLast do begin IndexMetadata := TableMetadata.IndexMetadatas.Add; IndexMetadata.Name := PrimaryKeys.GetStringByName('PK_NAME'); IndexMetadata.Fields := PrimaryKeys.GetStringByName('COLUMN_NAME'); IndexMetadata.Options := [ixPrimary, ixUnique]; if PrimaryKeys.Next then while AnsiSameStr(IndexMetadata.Name, PrimaryKeys.GetStringByName('COLUMN_NAME')) do begin IndexMetadata.Fields := ';' + IndexMetadata.Fields + PrimaryKeys.GetStringByName('COLUMN_NAME'); PrimaryKeys.Next; end; end; PrimaryKeys := nil; with Broker as TInstantZeosDBOBroker, Connector.Connection as TZConnection do IndexInfo := DbcConnection.GetMetadata.GetIndexInfo(Catalog, '', TableMetadata.Name, False, False); IndexInfo.First; while not IndexInfo.IsAfterLast do begin //Exclude primary keys IndexName := IndexInfo.GetStringByName('INDEX_NAME'); if not Assigned(TableMetadata.IndexMetadatas.Find(IndexName)) or //work around bug in GetPrimaryKeys for mysql driver where PK_NAME is not assigned (AnsiPos('PRI', IndexName) = 0) then begin IndexMetadata := TableMetadata.IndexMetadatas.Add; IndexMetadata.Name := IndexName; IndexMetadata.Fields := IndexInfo.GetStringByName('COLUMN_NAME'); IndexMetadata.Options := []; if not IndexInfo.GetBooleanByName('NON_UNIQUE') then IndexMetadata.Options := IndexMetadata.Options + [ixUnique]; if IndexInfo.GetStringByName('ASC_OR_DESC') = 'D' then IndexMetadata.Options := IndexMetadata.Options + [ixDescending]; if IndexInfo.Next then while AnsiSameStr(IndexMetadata.Name, IndexInfo.GetStringByName('COLUMN_NAME')) do begin IndexMetadata.Fields := ';' + IndexMetadata.Fields + IndexInfo.GetStringByName('COLUMN_NAME'); IndexInfo.Next; end; end else IndexInfo.Next; end; end; procedure TInstantZeosDBOCatalog.AddTableMetadatas( TableMetadatas: TInstantTableMetadatas); var TableMetadata: TInstantTableMetadata; Tables: IZResultSet; begin with Broker as TInstantZeosDBOBroker, Connector.Connection do begin if not Connector.Connected then Connector.Connect; Tables := DbcConnection.GetMetadata.GetTables(Catalog, '', '', nil); end; Tables.First; while not Tables.IsAfterLast do begin if AnsiSameStr(Tables.GetStringByName('TABLE_TYPE'), 'TABLE') then begin TableMetadata := TableMetadatas.Add; TableMetadata.Name := Tables.GetStringByName('TABLE_NAME'); // Call AddIndexMetadatas first, so that AddFieldMetadatas can see what // indexes are defined to correctly set the foIndexed option. AddIndexMetadatas(TableMetadata); AddFieldMetadatas(TableMetadata); end; Tables.Next; end; end; function TInstantZeosDBOCatalog.ColumnTypeToDataType(const ColumnType: TZSQLType; out AlternateDataTypes: TInstantDataTypes): TInstantDataType; begin AlternateDataTypes := []; case ColumnType of stString, stUnicodeString: Result := dtString; stBoolean: Result := dtBoolean; stShort: begin Result := dtBoolean; Include(AlternateDataTypes, dtInteger); end; stByte, stInteger, stLong: Result := dtInteger; stFloat, stDouble: begin Result := dtFloat; Include(AlternateDataTypes, dtCurrency); end; stBigDecimal: Result := dtCurrency; stDate, stTime, stTimeStamp: Result := dtDateTime; stBytes, stBinaryStream: Result := dtBlob; stAsciiStream, stUnicodeStream: Result := dtMemo; else raise Exception.CreateFmt(SUnsupportedColumnType, [GetEnumName(TypeInfo(TZSQLType), Ord(ColumnType))]); end; end; procedure TInstantZeosDBOCatalog.InitTableMetadatas( ATableMetadatas: TInstantTableMetadatas); begin ATableMetadatas.Clear; AddTableMetadatas(ATableMetadatas); end; end. Index: InstantZeosDBOConnectionDefEdit.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/InstantZeosDBOConnectionDefEdit.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InstantZeosDBOConnectionDefEdit.pas 5 Oct 2005 03:22:22 -0000 1.2 --- InstantZeosDBOConnectionDefEdit.pas 18 Oct 2005 22:55:18 -0000 1.3 *************** *** 49,52 **** --- 49,53 ---- ProtocolLabel: TLabel; DatabaseLabel: TLabel; + CatalogLabel: TLabel; UserNameLabel: TLabel; PasswordLabel: TLabel; *************** *** 59,62 **** --- 60,64 ---- ProtocolComboBox: TComboBox; DatabaseEdit: TEdit; + CatalogEdit: TEdit; DatabaseButton: TButton; UserNameEdit: TEdit; *************** *** 104,107 **** --- 106,110 ---- ProtocolComboBox.ItemIndex := ProtocolComboBox.Items.IndexOf(ConnectionDef.Protocol); DatabaseEdit.Text := ConnectionDef.Database; + CatalogEdit.Text := ConnectionDef.Catalog; UserNameEdit.Text := ConnectionDef.UserName; PasswordEdit.Text := ConnectionDef.Password; *************** *** 122,125 **** --- 125,129 ---- ConnectionDef.Protocol := ProtocolComboBox.Text; ConnectionDef.Database := DatabaseEdit.Text; + ConnectionDef.Catalog := CatalogEdit.Text; ConnectionDef.UserName := UserNameEdit.Text; ConnectionDef.Password := PasswordEdit.Text; Index: InstantZeosDBO.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/InstantZeosDBO.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InstantZeosDBO.pas 5 Oct 2005 03:22:22 -0000 1.2 --- InstantZeosDBO.pas 18 Oct 2005 22:55:18 -0000 1.3 *************** *** 55,58 **** --- 55,59 ---- TInstantZeosDBOConnectionDef = class(TInstantRelationalConnectionDef) private + FCatalog: string; FDatabase: string; FHostName: string; *************** *** 71,74 **** --- 72,76 ---- class function ConnectorClass: TInstantConnectorClass; override; published + property Catalog: string read FCatalog write FCatalog; property Database: string read FDatabase write FDatabase; property HostName: string read FHostName write FHostName; *************** *** 90,93 **** --- 92,96 ---- procedure DoAfterConnectionChange; procedure DoBeforeConnectionChange; + function GetConnection: TZConnection; procedure SetConnection(Value: TZConnection); procedure SetLoginPrompt(const Value: Boolean); *************** *** 113,117 **** function HasConnection: Boolean; published ! property Connection: TZConnection read FConnection write SetConnection; property LoginPrompt: Boolean read FLoginPrompt write SetLoginPrompt default False; property OnLogin: TLoginEvent read FOnLogin write FOnLogin; --- 116,120 ---- function HasConnection: Boolean; published ! property Connection: TZConnection read GetConnection write SetConnection; property LoginPrompt: Boolean read FLoginPrompt write SetLoginPrompt default False; property OnLogin: TLoginEvent read FOnLogin write FOnLogin; *************** *** 125,140 **** procedure AssignDataSetParams(DataSet: TDataSet; AParams: TParams); override; procedure AssignParam(SourceParam, TargetParam: TParam); virtual; function CreateResolver(Map: TInstantAttributeMap): TInstantSQLResolver; override; function GetDatabaseName: string; override; function GetSQLDelimiters: string; override; function GetSQLQuote: Char; override; function InternalCreateQuery: TInstantQuery; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; virtual; abstract; - function SupportsQuotedIdents: Boolean; virtual; abstract; function UseBooleanFields: Boolean; virtual; abstract; public function CreateDataSet(const AStatement: string; AParams: TParams = nil): TDataSet; override; ! function CreateDBBuildCommand( ! const CommandType: TInstantDBBuildCommandType): TInstantDBBuildCommand; override; function DataTypeToColumnType(DataType: TInstantDataType; Size: Integer): string; override; function Execute(const AStatement: string; AParams: TParams = nil): Integer; override; --- 128,144 ---- procedure AssignDataSetParams(DataSet: TDataSet; AParams: TParams); override; procedure AssignParam(SourceParam, TargetParam: TParam); virtual; + function CreateCatalog(const AScheme: TInstantScheme): TInstantCatalog; override; function CreateResolver(Map: TInstantAttributeMap): TInstantSQLResolver; override; + function DatabaseSQLDelimiter: string; function GetDatabaseName: string; override; + function GetDBMSName: string; override; function GetSQLDelimiters: string; override; function GetSQLQuote: Char; override; function InternalCreateQuery: TInstantQuery; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; virtual; abstract; function UseBooleanFields: Boolean; virtual; abstract; public function CreateDataSet(const AStatement: string; AParams: TParams = nil): TDataSet; override; ! function CreateDBBuildCommand(const CommandType: TInstantDBBuildCommandType): TInstantDBBuildCommand; override; function DataTypeToColumnType(DataType: TInstantDataType; Size: Integer): string; override; function Execute(const AStatement: string; AParams: TParams = nil): Integer; override; *************** *** 164,170 **** TInstantZeosDBOSybaseBroker = class(TInstantZeosDBOBroker) protected - function GetDBMSName: string; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; --- 168,172 ---- *************** *** 176,183 **** TInstantZeosDBOMSSQLBroker = class(TInstantZeosDBOBroker) protected - function CreateCatalog(const AScheme: TInstantScheme): TInstantCatalog; override; - function GetDBMSName: string; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; --- 178,182 ---- *************** *** 189,207 **** TInstantZeosDBOIbFbBroker = class(TInstantZeosDBOBroker) protected - function CreateCatalog(const AScheme: TInstantScheme): TInstantCatalog; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; - - TInstantZeosDBOInterbaseBroker = class(TInstantZeosDBOIbFbBroker) - protected - function GetDBMSName: string; override; - end; - - TInstantZeosDBOFirebirdBroker = class(TInstantZeosDBOIbFbBroker) - protected - function GetDBMSName: string; override; - end; {$ENDIF} --- 188,194 ---- *************** *** 211,217 **** TInstantZeosDBOOracleBroker = class(TInstantZeosDBOBroker) protected - function GetDBMSName: string; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; --- 198,202 ---- *************** *** 223,229 **** TInstantZeosDBOPgSQLBroker = class(TInstantZeosDBOBroker) protected - function GetDBMSName: string; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; --- 208,212 ---- *************** *** 235,241 **** TInstantZeosDBOMySQLBroker = class(TInstantZeosDBOBroker) protected - function GetDBMSName: string; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; --- 218,222 ---- *************** *** 247,276 **** TInstantZeosDBOSQLiteBroker = class(TInstantZeosDBOBroker) protected - function GetDBMSName: string; override; function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; - function SupportsQuotedIdents: Boolean; override; function UseBooleanFields: Boolean; override; end; {$ENDIF} ! procedure AssignZeosDBOProtocols(Strings: TStrings); implementation uses ! SysUtils, ! {$IFDEF D7+}Types,{$ENDIF} ! Controls, ! InstantConsts, ! InstantClasses, ! InstantDBBuild, ! {$IFDEF IBFB_SUPPORT}InstantIbFbCatalog,{$ENDIF} ! {$IFDEF MSSQL_SUPPORT}InstantMSSQLCatalog,{$ENDIF} ! InstantZeosDBOConnectionDefEdit, ! InstantUtils, ! ZClasses, ! ZCompatibility, ! ZDbcIntfs, ! ZDataset; { Global routines } --- 228,244 ---- TInstantZeosDBOSQLiteBroker = class(TInstantZeosDBOBroker) protected function InternalDataTypeToColumnType(DataType: TInstantDataType): string; override; function UseBooleanFields: Boolean; override; end; {$ENDIF} ! procedure AssignZeosDBOProtocols(Strings: TStrings); implementation uses ! SysUtils, {$IFDEF D7+}Types,{$ENDIF} Controls, InstantConsts, InstantClasses, ! InstantDBBuild, InstantZeosDBOConnectionDefEdit, InstantZeosDBOCatalog, ! InstantUtils, ZClasses, ZCompatibility, ZDbcIntfs, ZDataset; { Global routines } *************** *** 318,322 **** end; ! procedure TInstantZeosDBOConnectionDef.InitConnector(Connector: TInstantConnector); var Connection: TZConnection; --- 286,291 ---- end; ! procedure TInstantZeosDBOConnectionDef.InitConnector( ! Connector: TInstantConnector); var Connection: TZConnection; *************** *** 334,337 **** --- 303,307 ---- Connection.Properties.Text := Properties; Connection.Protocol := Protocol; + Connection.Catalog := Catalog; Connection.TransactIsolationLevel := tiReadCommitted; Connection.User := UserName; *************** *** 374,378 **** procedure TInstantZeosDBOConnector.CheckConnection; begin ! if not HasConnection then raise EInstantError.Create(SUnassignedConnection); end; --- 344,348 ---- procedure TInstantZeosDBOConnector.CheckConnection; begin ! if not Assigned(FConnection) then raise EInstantError.Create(SUnassignedConnection); end; *************** *** 393,445 **** begin CheckConnection; Result := nil; {$IFDEF SYBASE_SUPPORT} ! if SameText(Connection.Protocol, 'sybase') then Result := TInstantZeosDBOSybaseBroker.Create(Self); {$ENDIF} {$IFDEF MSSQL_SUPPORT} ! if SameText(Connection.Protocol, 'mssql') then Result := TInstantZeosDBOMSSQLBroker.Create(Self); {$ENDIF} {$IFDEF IBFB_SUPPORT} ! if SameText(Connection.Protocol, 'interbase-5') or ! SameText(Connection.Protocol, 'interbase-6') then ! Result := TInstantZeosDBOInterbaseBroker.Create(Self); ! ! if SameText(Connection.Protocol, 'firebird-1.0') or ! SameText(Connection.Protocol, 'firebird-1.5') then ! Result := TInstantZeosDBOFirebirdBroker.Create(Self); {$ENDIF} {$IFDEF ORACLE_SUPPORT} ! if SameText(Connection.Protocol, 'oracle') or ! SameText(Connection.Protocol, 'oracle-9i') then Result := TInstantZeosDBOOracleBroker.Create(Self); {$ENDIF} {$IFDEF PGSQL_SUPPORT} ! if SameText(Connection.Protocol, 'postgresql') or ! SameText(Connection.Protocol, 'postgresql-6.5') or ! SameText(Connection.Protocol, 'postgresql-7.2') or ! SameText(Connection.Protocol, 'postgresql-7.3') or ! SameText(Connection.Protocol, 'postgresql-7.4') then Result := TInstantZeosDBOPgSQLBroker.Create(Self); {$ENDIF} {$IFDEF MYSQL_SUPPORT} ! if SameText(Connection.Protocol, 'mysql') or ! SameText(Connection.Protocol, 'mysql-3.20') or ! SameText(Connection.Protocol, 'mysql-3.23') or ! SameText(Connection.Protocol, 'mysql-4.0') or ! SameText(Connection.Protocol, 'mysql-4.1') then Result := TInstantZeosDBOMySQLBroker.Create(Self); {$ENDIF} {$IFDEF SQLITE_SUPPORT} ! if SameText(Connection.Protocol, 'sqlite') or ! SameText(Connection.Protocol, 'sqlite-2.8') then Result := TInstantZeosDBOSQLiteBroker.Create(Self); {$ENDIF} --- 363,414 ---- begin CheckConnection; + Result := nil; {$IFDEF SYBASE_SUPPORT} ! if SameText(FConnection.Protocol, 'sybase') then Result := TInstantZeosDBOSybaseBroker.Create(Self); {$ENDIF} {$IFDEF MSSQL_SUPPORT} ! if SameText(FConnection.Protocol, 'mssql') then Result := TInstantZeosDBOMSSQLBroker.Create(Self); {$ENDIF} {$IFDEF IBFB_SUPPORT} ! if SameText(FConnection.Protocol, 'interbase-5') or ! SameText(FConnection.Protocol, 'interbase-6') or ! SameText(FConnection.Protocol, 'firebird-1.0') or ! SameText(FConnection.Protocol, 'firebird-1.5') then ! Result := TInstantZeosDBOIbFbBroker.Create(Self); {$ENDIF} {$IFDEF ORACLE_SUPPORT} ! if SameText(FConnection.Protocol, 'oracle') or ! SameText(FConnection.Protocol, 'oracle-9i') then Result := TInstantZeosDBOOracleBroker.Create(Self); {$ENDIF} {$IFDEF PGSQL_SUPPORT} ! if SameText(FConnection.Protocol, 'postgresql') or ! SameText(FConnection.Protocol, 'postgresql-6.5') or ! SameText(FConnection.Protocol, 'postgresql-7.2') or ! SameText(FConnection.Protocol, 'postgresql-7.3') or ! SameText(FConnection.Protocol, 'postgresql-7.4') then Result := TInstantZeosDBOPgSQLBroker.Create(Self); {$ENDIF} {$IFDEF MYSQL_SUPPORT} ! if SameText(FConnection.Protocol, 'mysql') or ! SameText(FConnection.Protocol, 'mysql-3.20') or ! SameText(FConnection.Protocol, 'mysql-3.23') or ! SameText(FConnection.Protocol, 'mysql-4.0') or ! SameText(FConnection.Protocol, 'mysql-4.1') then Result := TInstantZeosDBOMySQLBroker.Create(Self); {$ENDIF} {$IFDEF SQLITE_SUPPORT} ! if SameText(FConnection.Protocol, 'sqlite') or ! SameText(FConnection.Protocol, 'sqlite-2.8') then Result := TInstantZeosDBOSQLiteBroker.Create(Self); {$ENDIF} *************** *** 447,451 **** if Result = nil then raise EInstantError.CreateFmt('ZeosDBO protocol "%s" not supported', ! [Connection.Protocol]); end; --- 416,420 ---- if Result = nil then raise EInstantError.CreateFmt('ZeosDBO protocol "%s" not supported', ! [FConnection.Protocol]); end; *************** *** 475,478 **** --- 444,453 ---- end; + function TInstantZeosDBOConnector.GetConnection: TZConnection; + begin + CheckConnection; + Result := FConnection; + end; + function TInstantZeosDBOConnector.HasConnection: Boolean; begin *************** *** 480,485 **** end; ! procedure TInstantZeosDBOConnector.InternalBuildDatabase(Scheme: TInstantScheme); begin try inherited; --- 455,462 ---- end; ! procedure TInstantZeosDBOConnector.InternalBuildDatabase( ! Scheme: TInstantScheme); begin + StartTransaction; try inherited; *************** *** 493,498 **** procedure TInstantZeosDBOConnector.InternalCommitTransaction; begin ! if HasConnection and not Connection.AutoCommit then ! Connection.Commit; end; --- 470,476 ---- procedure TInstantZeosDBOConnector.InternalCommitTransaction; begin ! CheckConnection; ! if not FConnection.AutoCommit then ! FConnection.Commit; end; *************** *** 501,505 **** CheckConnection; AssignLoginOptions; ! Connection.Connect; end; --- 479,483 ---- CheckConnection; AssignLoginOptions; ! FConnection.Connect; end; *************** *** 507,517 **** begin if HasConnection then ! Connection.Disconnect; end; procedure TInstantZeosDBOConnector.InternalRollbackTransaction; begin ! if HasConnection and not Connection.AutoCommit then ! Connection.Rollback; end; --- 485,496 ---- begin if HasConnection then ! FConnection.Disconnect; end; procedure TInstantZeosDBOConnector.InternalRollbackTransaction; begin ! CheckConnection; ! if not FConnection.AutoCommit then ! FConnection.Rollback; end; *************** *** 561,568 **** { TInstantZeosDBOBroker } ! procedure TInstantZeosDBOBroker.AssignDataSetParams(DataSet: TDataSet; AParams: TParams); var i: Integer; ! TargetParams : TParams; SourceParam, TargetParam: TParam; begin --- 540,548 ---- { TInstantZeosDBOBroker } ! procedure TInstantZeosDBOBroker.AssignDataSetParams(DataSet: TDataSet; ! AParams: TParams); var i: Integer; ! TargetParams: TParams; SourceParam, TargetParam: TParam; begin *************** *** 603,606 **** --- 583,592 ---- end; + function TInstantZeosDBOBroker.CreateCatalog( + const AScheme: TInstantScheme): TInstantCatalog; + begin + Result := TInstantZeosDBOCatalog.Create(AScheme, Self); + end; + function TInstantZeosDBOBroker.CreateDataSet(const AStatement: string; AParams: TParams): TDataSet; *************** *** 609,617 **** begin Query := TZReadOnlyQuery.Create(nil); ! Query.Connection := Connector.Connection; ! Query.SQL.Text := AStatement; ! if Assigned(AParams) then ! AssignDatasetParams(Query, AParams); ! Result := Query; end; --- 595,608 ---- begin Query := TZReadOnlyQuery.Create(nil); ! try ! Query.Connection := Connector.Connection; ! Query.SQL.Text := AStatement; ! if Assigned(AParams) then ! AssignDatasetParams(Query, AParams); ! Result := Query; ! except ! Query.Free; ! raise; ! end; end; *************** *** 648,651 **** --- 639,649 ---- end; + function TInstantZeosDBOBroker.DatabaseSQLDelimiter: string; + begin + if Connector.Connected then + Result := Connector.Connection.DbcConnection.GetMetadata.GetIdentifierQuoteString; + { TODO : else? } + end; + function TInstantZeosDBOBroker.DataTypeToColumnType(DataType: TInstantDataType; Size: Integer): string; *************** *** 680,698 **** end; function TInstantZeosDBOBroker.GetSQLDelimiters: string; begin ! // This method returns the delimiter that *will be* used and we are ! // changing its behavior (choosing if will be used or not), thus, ! // it'll only supports double quote for the time being ! { TODO : TInstantSQLBroker needs to know if I want to use Delimiters or not } ! if Connector.UseDelimitedIdents and SupportsQuotedIdents then ! Result := '""' ! else ! Result := ''; //inherited GetSQLDelimiters; end; function TInstantZeosDBOBroker.GetSQLQuote: Char; begin - { TODO : Check Oracle and SQLite compatibility. } Result := ''''; end; --- 678,697 ---- end; + function TInstantZeosDBOBroker.GetDBMSName: string; + begin + if Connector.Connected then + Result := Connector.Connection.DbcConnection.GetMetadata.GetDatabaseProductName; + { TODO : else? } + end; + function TInstantZeosDBOBroker.GetSQLDelimiters: string; begin ! Result := DatabaseSQLDelimiter; ! if not Connector.UseDelimitedIdents or (Result = ' ') then ! Result := ''; end; function TInstantZeosDBOBroker.GetSQLQuote: Char; begin Result := ''''; end; *************** *** 723,727 **** Writer.WriteChar('1'); Result := True; ! end else if SameText(Constant.Value, InstantFalseString) then begin Writer.WriteChar('0'); --- 722,727 ---- Writer.WriteChar('1'); Result := True; ! end else ! if SameText(Constant.Value, InstantFalseString) then begin Writer.WriteChar('0'); *************** *** 741,772 **** {$IFDEF SYBASE_SUPPORT} - function TInstantZeosDBOSybaseBroker.GetDBMSName: string; - begin - Result := 'Sybase'; - end; - function TInstantZeosDBOSybaseBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'DOUBLE PRECISION', ! 'MONEY', ! 'TINYINT', ! 'VARCHAR', ! 'TEXT', ! 'DATETIME', ! 'IMAGE'); begin Result := Types[DataType]; end; - function TInstantZeosDBOSybaseBroker.SupportsQuotedIdents: Boolean; - begin - // Sybase needs a "SET quoted_identifier ON" before first statement using - // Quoted Identifier - Result := False; - end; - function TInstantZeosDBOSybaseBroker.UseBooleanFields: Boolean; begin --- 741,760 ---- {$IFDEF SYBASE_SUPPORT} function TInstantZeosDBOSybaseBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'DOUBLE PRECISION', ! 'MONEY', ! 'TINYINT', ! 'VARCHAR', ! 'TEXT', ! 'DATETIME', ! 'IMAGE'); begin Result := Types[DataType]; end; function TInstantZeosDBOSybaseBroker.UseBooleanFields: Boolean; begin *************** *** 778,814 **** {$IFDEF MSSQL_SUPPORT} - function TInstantZeosDBOMSSQLBroker.CreateCatalog( - const AScheme: TInstantScheme): TInstantCatalog; - begin - Result := TInstantMSSQLCatalog.Create(AScheme, Self); - end; - - function TInstantZeosDBOMSSQLBroker.GetDBMSName: string; - begin - Result := 'MS SQL Server'; - end; - function TInstantZeosDBOMSSQLBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT', ! 'MONEY', ! 'BIT', ! 'VARCHAR', ! 'TEXT', ! 'DATETIME', ! 'IMAGE'); begin Result := Types[DataType]; end; - function TInstantZeosDBOMSSQLBroker.SupportsQuotedIdents: Boolean; - begin - { TODO : Check } - Result := False; - end; - function TInstantZeosDBOMSSQLBroker.UseBooleanFields: Boolean; begin --- 766,785 ---- {$IFDEF MSSQL_SUPPORT} function TInstantZeosDBOMSSQLBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT', ! 'MONEY', ! 'BIT', ! 'VARCHAR', ! 'TEXT', ! 'DATETIME', ! 'IMAGE'); begin Result := Types[DataType]; end; function TInstantZeosDBOMSSQLBroker.UseBooleanFields: Boolean; begin *************** *** 824,868 **** const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'DOUBLE PRECISION', ! 'DECIMAL(14,4)', ! 'SMALLINT', ! 'VARCHAR', ! 'BLOB SUB_TYPE 1', ! 'TIMESTAMP', ! 'BLOB'); begin Result := Types[DataType]; end; - function TInstantZeosDBOIbFbBroker.CreateCatalog( - const AScheme: TInstantScheme): TInstantCatalog; - begin - Result := TInstantIbFbCatalog.Create(AScheme, Self); - end; - - function TInstantZeosDBOIbFbBroker.SupportsQuotedIdents: Boolean; - begin - Result := True; - end; - function TInstantZeosDBOIbFbBroker.UseBooleanFields: Boolean; begin Result := False; end; - - { TInstantZeosDBOInterbaseBroker } - - function TInstantZeosDBOInterbaseBroker.GetDBMSName: string; - begin - Result := 'Interbase'; - end; - - { TInstantZeosDBOFirebirdBroker } - - function TInstantZeosDBOFirebirdBroker.GetDBMSName: string; - begin - Result := 'Firebird'; - end; {$ENDIF} --- 795,814 ---- const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'DOUBLE PRECISION', ! 'DECIMAL(14,4)', ! 'SMALLINT', ! 'VARCHAR', ! 'BLOB SUB_TYPE 1', ! 'TIMESTAMP', ! 'BLOB'); begin Result := Types[DataType]; end; function TInstantZeosDBOIbFbBroker.UseBooleanFields: Boolean; begin Result := False; end; {$ENDIF} *************** *** 870,908 **** {$IFDEF ORACLE_SUPPORT} - function TInstantZeosDBOOracleBroker.GetDBMSName: string; - begin - Result := 'Oracle'; - end; - function TInstantZeosDBOOracleBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; - (* const - //dtInteger, dtFloat, dtCurrency, dtBoolean, dtString, dtMemo, dtDateTime, dtBlob Types: array[TInstantDataType] of string = ( ! '', ! '', ! '', ! '', ! '', ! '', ! '', ! ''); ! *) ! begin ! //Result := Types[DataType]; ! { TODO : Implement } ! raise EInstantError.Create('Oracle protocol not implemented yet'); ! end; ! ! function TInstantZeosDBOOracleBroker.SupportsQuotedIdents: Boolean; begin ! { TODO : Chech } ! Result := False; end; function TInstantZeosDBOOracleBroker.UseBooleanFields: Boolean; begin - { TODO : Check } Result := False; end; --- 816,837 ---- {$IFDEF ORACLE_SUPPORT} function TInstantZeosDBOOracleBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'NUMBER(10)', ! 'FLOAT', ! 'NUMBER(14,4)', ! 'NUMBER(1)', ! 'VARCHAR2', ! 'CLOB', ! 'DATE', ! 'BLOB'); begin ! Result := Types[DataType]; end; function TInstantZeosDBOOracleBroker.UseBooleanFields: Boolean; begin Result := False; end; *************** *** 912,941 **** {$IFDEF PGSQL_SUPPORT} - function TInstantZeosDBOPgSQLBroker.GetDBMSName: string; - begin - Result := 'PostgreSQL'; - end; - function TInstantZeosDBOPgSQLBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT8', ! 'DECIMAL(14,4)', ! 'BOOLEAN', ! 'VARCHAR', ! 'TEXT', ! 'TIMESTAMP', ! 'BYTEA'); begin Result := Types[DataType]; end; - function TInstantZeosDBOPgSQLBroker.SupportsQuotedIdents: Boolean; - begin - Result := True; - end; - function TInstantZeosDBOPgSQLBroker.UseBooleanFields: Boolean; begin --- 841,860 ---- {$IFDEF PGSQL_SUPPORT} function TInstantZeosDBOPgSQLBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT8', ! 'DECIMAL(14,4)', ! 'BOOLEAN', ! 'VARCHAR', ! 'TEXT', ! 'TIMESTAMP', ! 'BYTEA'); begin Result := Types[DataType]; end; function TInstantZeosDBOPgSQLBroker.UseBooleanFields: Boolean; begin *************** *** 947,980 **** {$IFDEF MYSQL_SUPPORT} - function TInstantZeosDBOMySQLBroker.GetDBMSName: string; - begin - Result := 'MySQL'; - end; - function TInstantZeosDBOMySQLBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT', ! 'DECIMAL(14,4)', ! 'TINYINT(1)', ! 'VARCHAR', ! 'TEXT', ! 'DATETIME', ! 'BLOB'); begin Result := Types[DataType]; end; - function TInstantZeosDBOMySQLBroker.SupportsQuotedIdents: Boolean; - begin - { TODO : Check } - Result := False; - end; - function TInstantZeosDBOMySQLBroker.UseBooleanFields: Boolean; begin ! Result := False; end; {$ENDIF} --- 866,888 ---- {$IFDEF MYSQL_SUPPORT} function TInstantZeosDBOMySQLBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT', ! 'DECIMAL(14,4)', ! 'BOOL', ! 'VARCHAR', ! 'TEXT', ! 'DATETIME', ! 'BLOB'); begin Result := Types[DataType]; end; function TInstantZeosDBOMySQLBroker.UseBooleanFields: Boolean; begin ! Result := True; end; {$ENDIF} *************** *** 983,1013 **** {$IFDEF SQLITE_SUPPORT} - function TInstantZeosDBOSQLiteBroker.GetDBMSName: string; - begin - Result := 'SQLite'; - end; - function TInstantZeosDBOSQLiteBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT', ! 'NUMERIC(14,4)', ! 'BOOLEAN', ! 'VARCHAR', ! 'TEXT', ! 'TIMESTAMP', ! 'BLOB'); begin Result := Types[DataType]; end; - function TInstantZeosDBOSQLiteBroker.SupportsQuotedIdents: Boolean; - begin - { TODO : Check } - Result := False; - end; - function TInstantZeosDBOSQLiteBroker.UseBooleanFields: Boolean; begin --- 891,910 ---- {$IFDEF SQLITE_SUPPORT} function TInstantZeosDBOSQLiteBroker.InternalDataTypeToColumnType( DataType: TInstantDataType): string; const Types: array[TInstantDataType] of string = ( ! 'INTEGER', ! 'FLOAT', ! 'NUMERIC(14,4)', ! 'BOOLEAN', ! 'VARCHAR', ! 'TEXT', ! 'TIMESTAMP', ! 'BLOB'); begin Result := Types[DataType]; end; function TInstantZeosDBOSQLiteBroker.UseBooleanFields: Boolean; begin |
From: Joao M. <jcm...@us...> - 2005-10-18 22:55:28
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30445/Brokers/ZeosDBO/D6 Added Files: DclIOZeosDBO.dpk IOZeosDBO.dpk Log Message: Implemented ZeosDBO catalog, finished support for all databases, fixed packages for new catalog implementation, broker improvements. --- NEW FILE: DclIOZeosDBO.dpk --- package DclIOZeosDBO; {$I '..\..\..\InstantVersion.inc'} {$R '..\InstantZeosDBO.dcr'} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS ON} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects ZeosDBO Design-Time Support (Delphi 6)'} {$LIBSUFFIX '_D6'} {$DESIGNONLY} {$IMPLICITBUILD OFF} requires IOZeosDBO; contains InstantZeosDBOReg in '..\InstantZeosDBOReg.pas'; end. --- NEW FILE: IOZeosDBO.dpk --- package IOZeosDBO; {$I '..\..\..\InstantVersion.inc'} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS ON} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects ZeosDBO Run-Time Support (Delphi 6)'} {$LIBSUFFIX '_D6'} {$RUNONLY} {$IMPLICITBUILD OFF} requires IOCore, ZComponent; contains InstantZeosDBO in '..\InstantZeosDBO.pas', InstantZeosDBOCatalog in '..\InstantZeosDBOCatalog.pas', InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}; end. |
From: Joao M. <jcm...@us...> - 2005-10-18 22:55:28
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D2005 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30445/Brokers/ZeosDBO/D2005 Modified Files: IOZeosDBO.dpk Log Message: Implemented ZeosDBO catalog, finished support for all databases, fixed packages for new catalog implementation, broker improvements. Index: IOZeosDBO.dpk =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D2005/IOZeosDBO.dpk,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IOZeosDBO.dpk 17 Oct 2005 19:42:05 -0000 1.1 --- IOZeosDBO.dpk 18 Oct 2005 22:55:17 -0000 1.2 *************** *** 31,42 **** requires IOCore, ! ZComponent, ! IOIbFbCatalog, ! IOMSSqlCatalog; contains ! InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}, ! InstantZeosDBO in '..\InstantZeosDBO.pas'; end. - --- 31,40 ---- requires IOCore, ! ZComponent; contains ! InstantZeosDBO in '..\InstantZeosDBO.pas', ! InstantZeosDBOCatalog in '..\InstantZeosDBOCatalog.pas', ! InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}; end. |
From: Joao M. <jcm...@us...> - 2005-10-18 22:49:18
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23611/D6 Log Message: Directory /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D6 added to the repository |
From: Carlo B. <car...@us...> - 2005-10-18 13:17:33
|
Update of /cvsroot/instantobjects/Source/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8685/Source/Tests Modified Files: TestIO.cfg TestIO.dof TestIO.res Log Message: Intro demo and TestIO: used InstantObjects Icon and update search path to compile without library path. Index: TestIO.cfg =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.cfg,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestIO.cfg 18 Oct 2005 03:10:19 -0000 1.7 --- TestIO.cfg 18 Oct 2005 13:17:21 -0000 1.8 *************** *** 34,41 **** -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"D:\L\ubmock\src" ! -O"D:\L\ubmock\src" ! -I"D:\L\ubmock\src" ! -R"D:\L\ubmock\src" -w-UNSAFE_TYPE -w-UNSAFE_CODE --- 34,41 ---- -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"..\core" ! -O"..\core" ! -I"..\core" ! -R"..\core" -w-UNSAFE_TYPE -w-UNSAFE_CODE Index: TestIO.dof =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.dof,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestIO.dof 18 Oct 2005 03:10:19 -0000 1.7 --- TestIO.dof 18 Oct 2005 13:17:21 -0000 1.8 *************** *** 95,102 **** PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=D:\L\ubmock\src Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;adortl;vclactnband;vclshlctrls;CS30Logging70;Rz30Ctls70;Rz30DBCtls70;ip4000v7;Rave60VCL;Rave60CLX;madBasic_;madDisAsm_;CLXIB;ibxpress;VCLIB;IOCore;IOIBX Conditionals= ! DebugSourceDirs=D:\L\InstantObjects\Source\Core UsePackages=0 [Parameters] --- 95,102 ---- PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=..\core Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;adortl;vclactnband;vclshlctrls;CS30Logging70;Rz30Ctls70;Rz30DBCtls70;ip4000v7;Rave60VCL;Rave60CLX;madBasic_;madDisAsm_;CLXIB;ibxpress;VCLIB;IOCore;IOIBX Conditionals= ! DebugSourceDirs=..\core UsePackages=0 [Parameters] Index: TestIO.res =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.res,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsWEzYTB and /tmp/cvshclzOV differ |
From: Carlo B. <car...@us...> - 2005-10-18 13:17:31
|
Update of /cvsroot/instantobjects/Demos/Intro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8685/Demos/Intro Modified Files: Intro.cfg Intro.dof Intro.res Log Message: Intro demo and TestIO: used InstantObjects Icon and update search path to compile without library path. Index: Intro.dof =================================================================== RCS file: /cvsroot/instantobjects/Demos/Intro/Intro.dof,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Intro.dof 10 Feb 2005 23:06:09 -0000 1.2 --- Intro.dof 18 Oct 2005 13:17:21 -0000 1.3 *************** *** 1,4 **** [Compiler] ! A=1 B=0 C=1 --- 1,6 ---- + [FileVersion] + Version=7.0 [Compiler] ! A=8 B=0 C=1 *************** *** 29,33 **** ShowWarnings=1 UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; ! [Linker] MapFile=0 --- 31,83 ---- ShowWarnings=1 UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; ! NamespacePrefix= ! SymbolDeprecated=1 ! SymbolLibrary=1 ! SymbolPlatform=1 ! UnitLibrary=1 ! UnitPlatform=1 ! UnitDeprecated=1 ! HResultCompat=1 ! HidingMember=1 ! HiddenVirtual=1 ! Garbage=1 ! BoundsError=1 ! ZeroNilCompat=1 ! StringConstTruncated=1 ! ForLoopVarVarPar=1 ! TypedConstVarPar=1 ! AsgToTypedConst=1 ! CaseLabelRange=1 ! ForVariable=1 ! ConstructingAbstract=1 ! ComparisonFalse=1 ! ComparisonTrue=1 ! ComparingSignedUnsigned=1 ! CombiningSignedUnsigned=1 ! UnsupportedConstruct=1 ! FileOpen=1 ! FileOpenUnitSrc=1 ! BadGlobalSymbol=1 ! DuplicateConstructorDestructor=1 ! InvalidDirective=1 ! PackageNoLink=1 ! PackageThreadVar=1 ! ImplicitImport=1 ! HPPEMITIgnored=1 ! NoRetVal=1 ! UseBeforeDef=1 ! ForLoopVarUndef=1 ! UnitNameMismatch=1 ! NoCFGFileFound=1 ! MessageDirective=1 ! ImplicitVariants=1 ! UnicodeToLocale=1 ! LocaleToUnicode=1 ! ImagebaseMultiple=1 ! SuspiciousTypecast=1 ! PrivatePropAccessor=1 ! UnsafeType=1 ! UnsafeCode=1 ! UnsafeCast=1 [Linker] MapFile=0 *************** *** 40,44 **** ImageBase=4194304 ExeDescription= - [Directories] OutputDir= --- 90,93 ---- *************** *** 46,64 **** PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=$(DELPHI)\Lib\Debug;..\..\Source\Brokers\BDE Packages=VCL50;VCLX50;VCLSMP50;VCLDB50;VCLADO50;ibevnt50;VCLBDE50;VCLDBX50;QRPT50;TEEUI50;TEEDB50;TEE50;DSS50;TEEQR50;VCLIB50;VCLIE50;INETDB50;INET50;VCLMID50;NMFAST50;WEBMID50;dclocx50;dclaxserver50;Orbit50;Bgo23;Bgo22;RBTDBC51;RBRCL45;RBCIDE45;RBIDE45;RBBDE45;RBUSER45;RBDB45;dclRBA45;RBDAD45;dclRBI45;TSDG5201;TSG5201 Conditionals= DebugSourceDirs= UsePackages=0 - [Parameters] RunParams= HostApplication= ! [Language] ActiveLang= ProjectLang=$00000406 RootDir= - [Version Info] IncludeVerInfo=0 --- 95,113 ---- PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=..\..\Source\Core;..\..\Source\Brokers\BDE;..\..\Source\Catalogs\BDE Packages=VCL50;VCLX50;VCLSMP50;VCLDB50;VCLADO50;ibevnt50;VCLBDE50;VCLDBX50;QRPT50;TEEUI50;TEEDB50;TEE50;DSS50;TEEQR50;VCLIB50;VCLIE50;INETDB50;INET50;VCLMID50;NMFAST50;WEBMID50;dclocx50;dclaxserver50;Orbit50;Bgo23;Bgo22;RBTDBC51;RBRCL45;RBCIDE45;RBIDE45;RBBDE45;RBUSER45;RBDB45;dclRBA45;RBDAD45;dclRBI45;TSDG5201;TSG5201 Conditionals= DebugSourceDirs= UsePackages=0 [Parameters] RunParams= HostApplication= ! Launcher= ! UseLauncher=0 ! DebugCWD= [Language] ActiveLang= ProjectLang=$00000406 RootDir= [Version Info] IncludeVerInfo=0 *************** *** 75,79 **** Locale=1030 CodePage=1252 - [Version Info Keys] CompanyName= --- 124,127 ---- *************** *** 87,96 **** ProductVersion=1.0.0.0 Comments= ! [HistoryLists\hlUnitAliases] Count=1 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - [HistoryLists\hlSearchPath] ! Count=1 ! Item0=$(DELPHI)\Lib\Debug --- 135,151 ---- ProductVersion=1.0.0.0 Comments= ! [Excluded Packages] ! c:\programmi\borland\delphi7\Projects\Bpl\CBCLX70.bpl=** CBCLX Package Delphi 7: CLX components ** ! c:\programmi\borland\delphi7\Projects\Bpl\CBRBuilder70.bpl=*** CBRBuilderVCL ReportBuilder VCL Support *** ! c:\programmi\borland\delphi7\Projects\Bpl\OOoPackage70.bpl=* Ethea - OpenOffice.org Components * ! c:\programmi\borland\delphi7\Projects\Bpl\CBDesign70.bpl=*** Design-time property-editors Delphi 7 per CBVCL *** ! C:\WINDOWS\system32\rbIBE77.bpl=ReportBuilder Data Access for Interbase Express [HistoryLists\hlUnitAliases] Count=1 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; [HistoryLists\hlSearchPath] ! Count=4 ! Item0=..\..\Source\Core;..\..\Source\Brokers\BDE;..\..\Source\Catalogs\BDE ! Item1=..\..\Source\Brokers\BDE;..\..\Source\Core ! Item2=$(DELPHI)\Lib\Debug;..\..\Source\Brokers\BDE ! Item3=$(DELPHI)\Lib\Debug Index: Intro.cfg =================================================================== RCS file: /cvsroot/instantobjects/Demos/Intro/Intro.cfg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Intro.cfg 2 Feb 2004 20:55:16 -0000 1.1 --- Intro.cfg 18 Oct 2005 13:17:20 -0000 1.2 *************** *** 1,3 **** ! -$A+ -$B- -$C+ --- 1,3 ---- ! -$A8 -$B- -$C+ *************** *** 33,40 **** -$M16384,1048576 -K$00400000 ! -LE"c:\programmer\borland\delphi5\Projects\Bpl" ! -LN"c:\programmer\borland\delphi5\Projects\Bpl" ! -U"c:\programmer\borland\delphi5\Lib\Debug" ! -O"c:\programmer\borland\delphi5\Lib\Debug" ! -I"c:\programmer\borland\delphi5\Lib\Debug" ! -R"c:\programmer\borland\delphi5\Lib\Debug" --- 33,40 ---- -$M16384,1048576 -K$00400000 ! -LE"c:\programmi\borland\delphi7\Projects\Bpl" ! -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"..\..\Source\Core;..\..\Source\Brokers\BDE;..\..\Source\Catalogs\BDE" ! -O"..\..\Source\Core;..\..\Source\Brokers\BDE;..\..\Source\Catalogs\BDE" ! -I"..\..\Source\Core;..\..\Source\Brokers\BDE;..\..\Source\Catalogs\BDE" ! -R"..\..\Source\Core;..\..\Source\Brokers\BDE;..\..\Source\Catalogs\BDE" Index: Intro.res =================================================================== RCS file: /cvsroot/instantobjects/Demos/Intro/Intro.res,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvss99kpt and /tmp/cvs1a723M differ |
From: Steven M. <sr...@us...> - 2005-10-18 09:18:04
|
Update of /cvsroot/instantobjects/Source/Brokers/XML/k3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15073 Modified Files: IOXML.dpk Log Message: Update .res statement with InstantVersion.inc. Index: IOXML.dpk =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/XML/k3/IOXML.dpk,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IOXML.dpk 16 Sep 2005 17:22:18 -0000 1.3 --- IOXML.dpk 18 Oct 2005 09:17:51 -0000 1.4 *************** *** 1,5 **** package IOXML; ! {$R *.res} {$ALIGN 8} {$ASSERTIONS ON} --- 1,6 ---- package IOXML; ! {$I '../../../InstantVersion.inc'} ! {$ALIGN 8} {$ASSERTIONS ON} |
From: Steven M. <sr...@us...> - 2005-10-18 09:14:59
|
Update of /cvsroot/instantobjects/Source/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13665 Modified Files: InstantPersistence.pas Log Message: Simplify TInstantBroker.IsCatalogSupported code. Index: InstantPersistence.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantPersistence.pas,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** InstantPersistence.pas 18 Oct 2005 03:08:31 -0000 1.60 --- InstantPersistence.pas 18 Oct 2005 09:14:49 -0000 1.61 *************** *** 10143,10157 **** vCatalog: TInstantCatalog; begin ! // Result := CreateCatalog(nil) <> nil; ! vCatalog := nil; ! try ! try ! vCatalog := CreateCatalog(nil); ! Result := Assigned(vCatalog); ! except ! Result := False; ! raise; ! end; finally vCatalog.Free; --- 10143,10149 ---- vCatalog: TInstantCatalog; begin ! vCatalog := CreateCatalog(nil); try ! Result := Assigned(vCatalog); finally vCatalog.Free; |
From: Steven M. <sr...@us...> - 2005-10-18 08:37:53
|
Update of /cvsroot/instantobjects/Source/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5456 Added Files: TestInstantReferences.pas TestInstantParts.pas TestInstantObjectStore.pas TestInstantCache.pas TestInstantObjectState.pas Log Message: Add new test units. --- NEW FILE: TestInstantObjectState.pas --- (* * InstantObjects Test Suite * TestInstantObjectState *) (* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is: InstantObjects Test Suite/TestInstantObjectState * * The Initial Developer of the Original Code is: Steven Mitchell * * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * * ***** END LICENSE BLOCK ***** *) unit TestInstantObjectState; interface uses fpcunit, InstantPersistence; type // Test methods for class TInstantObjectState TestTInstantObjectState = class(TTestCase) private FInstantObjectState: TInstantObjectState; public procedure SetUp; override; procedure TearDown; override; published procedure TestAssign; end; implementation uses SysUtils, Classes, testregistry, InstantClasses; procedure TestTInstantObjectState.SetUp; begin FInstantObjectState := TInstantObjectState.Create; FInstantObjectState.IsChanged := True; FInstantObjectState.PersistentId := 'ObjectStateId'; FInstantObjectState.UpdateCount := 0; end; procedure TestTInstantObjectState.TearDown; begin FreeAndNil(FInstantObjectState); end; procedure TestTInstantObjectState.TestAssign; var Source: TPersistent; begin Source := TInstantObjectState.Create; try with Source as TInstantObjectState do begin IsChanged := True; PersistentId := 'SourceId'; UpdateCount := 10; end; FInstantObjectState.Assign(Source); AssertTrue(FInstantObjectState.IsChanged); AssertEquals('SourceId', FInstantObjectState.PersistentId); AssertEquals(10, FInstantObjectState.UpdateCount); finally Source.Free; end; end; initialization // Register any test cases with the test runner {$IFNDEF CURR_TESTS} RegisterTests([TestTInstantObjectState]); {$ENDIF} end. --- NEW FILE: TestInstantReferences.pas --- (* * InstantObjects Test Suite * TestInstantReferences *) (* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is: InstantObjects Test Suite/TestInstantReferences * * The Initial Developer of the Original Code is: Steven Mitchell * * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * * ***** END LICENSE BLOCK ***** *) unit TestInstantReferences; interface uses fpcunit, InstantMock, InstantPersistence, TestModel; type TestTInstantReferences_Leak = class(TTestCase) private FConn: TInstantMockConnector; FInstantReferences: TInstantReferences; FOwner: TCompany; public procedure SetUp; override; procedure TearDown; override; published procedure TestAddEmbeddedObject; procedure TestAddExternalObject; end; implementation uses SysUtils, Classes, testregistry; procedure TestTInstantReferences_Leak.SetUp; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FOwner := TCompany.Create(FConn); end; procedure TestTInstantReferences_Leak.TearDown; begin // FInstantParts.Clear; FInstantReferences := nil; FreeAndNil(FOwner); InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTInstantReferences_Leak.TestAddEmbeddedObject; var vReturnValue: Integer; vReference: TPerson; begin FInstantReferences := FOwner._Employees; vReference := TPerson.Create(FConn); try vReturnValue := FInstantReferences.Add(vReference); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantReferences.Count 1', 1, FInstantReferences.Count); AssertEquals('vReference.RefCount 1', 2, vReference.RefCount); vReturnValue := FInstantReferences.Remove(vReference); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantReferences.Count 2', 0, FInstantReferences.Count); AssertEquals('vReference.RefCount 2', 1, vReference.RefCount); finally vReference.Free; // AssertException(EAccessViolation, vReference.Free); end; end; procedure TestTInstantReferences_Leak.TestAddExternalObject; var vReturnValue: Integer; vReference: TProject; begin FInstantReferences := FOwner._Projects; vReference := TProject.Create(FConn); try AssertEquals(1, vReference.RefCount); vReturnValue := FInstantReferences.Add(vReference); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantReferences.Count 1', 1, FInstantReferences.Count); AssertEquals('vReference.RefCount 1', 2, vReference.RefCount); vReturnValue := FInstantReferences.Remove(vReference); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantReferences.Count 2', 0, FInstantReferences.Count); AssertEquals('vReference.RefCount 2', 1, vReference.RefCount); finally vReference.Free; // AssertException(EAccessViolation, vReference.Free); end; end; initialization // Register any test cases with the test runner {$IFNDEF CURR_TESTS} RegisterTests([//TestTInstantExtReferences, //TestTinstantEmbReferences, TestTInstantReferences_Leak]); {$ELSE} RegisterTests([//TestTInstantExtReferences, //TestTinstantEmbReferences, TestTInstantReferences_Leak ]); {$ENDIF} end. --- NEW FILE: TestInstantObjectStore.pas --- (* * InstantObjects Test Suite * TestInstantObjectStore *) (* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is: InstantObjects Test Suite/TestInstantObjectStore * * The Initial Developer of the Original Code is: Steven Mitchell * * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * * ***** END LICENSE BLOCK ***** *) unit TestInstantObjectStore; interface uses fpcunit, InstantPersistence, InstantMock, TestModel; type // Test methods for class TInstantObjectStore TestTInstantObjectStore = class(TTestCase) private FConn: TInstantMockConnector; FInstantObjectStore: TInstantObjectStore; public procedure SetUp; override; procedure TearDown; override; published procedure TestFind_AbandonObjects; procedure TestDispose_Refresh_StoreObject_ObjectDestroyed; end; // Test methods for class TInstantObjectStores TestTInstantObjectStores = class(TTestCase) private FConn: TInstantMockConnector; FInstantObjectStores: TInstantObjectStores; public procedure SetUp; override; procedure TearDown; override; published procedure TestAddObjectStore; procedure TestFindObjectStore; end; implementation uses SysUtils, testregistry, InstantClasses; procedure TestTInstantObjectStore.SetUp; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockCRBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FInstantObjectStore := FConn.EnsureObjectStore(TPerson); AssertNotNull(FInstantObjectStore); end; procedure TestTInstantObjectStore.TearDown; begin FInstantObjectStore := nil; InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTInstantObjectStore.TestFind_AbandonObjects; var vObjectId: string; vPerson1: TPerson; vPerson2: TPerson; begin vPerson2 := nil; AssertEquals(0, FInstantObjectStore.Count); vPerson1 := TPerson.Create(FConn); try AssertNotNull(vPerson1); vPerson1.Name := 'AName1'; vPerson1.Store; vObjectId := vPerson1.PersistentId; AssertEquals(1, FInstantObjectStore.Count); vPerson2 := TPerson.Create(FConn); AssertNotNull(vPerson2); vPerson2.Name := 'AName2'; vPerson2.Store; AssertEquals(2, FInstantObjectStore.Count); AssertSame(vPerson1, TPerson(FInstantObjectStore.Find(vObjectId))); AssertEquals('AName1', TPerson(FInstantObjectStore.Find(vObjectId)).Name); AssertNotNull(vPerson1.Connector); AssertNotNull(vPerson2.Connector); FInstantObjectStore.AbandonObjects; AssertNull(vPerson1.Connector); AssertNull(vPerson2.Connector); // Remove abandoned objects from cache FInstantObjectStore.ObjectDestroyed(vPerson1); FInstantObjectStore.ObjectDestroyed(vPerson2); finally vPerson1.Free; vPerson2.Free; end; end; procedure TestTInstantObjectStore.TestDispose_Refresh_StoreObject_ObjectDestroyed; var vObjectId: string; vPerson: TPerson; vBrock: TInstantMockCRBroker; begin AssertEquals(0, FInstantObjectStore.Count); vBrock := FConn.Broker as TInstantMockCRBroker; vBrock.MockManager.EndSetUp; vPerson := TPerson.Create(FConn); try AssertNotNull(vPerson); vPerson.Name := 'AName'; vPerson.Store; vObjectId := vPerson.PersistentId; vBrock.MockManager.StartSetUp; vBrock.MockManager.AddExpectation('InternalStoreObject caFail ' + vObjectId); vBrock.MockManager.Verify; AssertEquals(1, FInstantObjectStore.Count); vBrock.MockManager.EndSetUp; FInstantObjectStore.DisposeObject(vPerson, caFail); vBrock.MockManager.StartSetUp; vBrock.MockManager.AddExpectation('InternalDisposeObject caFail ' + vObjectId); vBrock.MockManager.Verify; AssertEquals(0, FInstantObjectStore.Count); AssertEquals('AName', vPerson.Name); vBrock.MockManager.EndSetUp; FInstantObjectStore.RefreshObject(vPerson); vBrock.MockManager.StartSetUp; vBrock.MockManager.AddExpectation('InternalRetrieveObject caFail '); vBrock.MockManager.Verify; vBrock.MockManager.EndSetUp; FInstantObjectStore.ObjectDestroyed(vPerson); vBrock.MockManager.StartSetUp; vBrock.MockManager.Verify; AssertEquals(0, FInstantObjectStore.Count); AssertEquals('AName', vPerson.Name); FInstantObjectStore.RefreshObject(vPerson); vBrock.MockManager.EndSetUp; FInstantObjectStore.StoreObject(vPerson, caFail); vBrock.MockManager.StartSetUp; vBrock.MockManager.AddExpectation('InternalStoreObject caFail ' + vObjectId); vBrock.MockManager.Verify; AssertEquals(1, FInstantObjectStore.Count); AssertEquals('AName', vPerson.Name); finally vPerson.Free; end; end; procedure TestTInstantObjectStores.SetUp; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FInstantObjectStores := FConn.ObjectStores; FConn.EnsureObjectStore(TPerson); end; procedure TestTInstantObjectStores.TearDown; begin FInstantObjectStores := nil; InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTInstantObjectStores.TestAddObjectStore; var vInitCnt: Integer; vReturnValue: TInstantObjectStore; begin vInitCnt := FInstantObjectStores.Count; vReturnValue := FInstantObjectStores.AddObjectStore; AssertNotNull(vReturnValue); AssertEquals(vInitCnt + 1, FInstantObjectStores.Count); end; procedure TestTInstantObjectStores.TestFindObjectStore; var vReturnValue: TInstantObjectStore; begin vReturnValue := FInstantObjectStores.FindObjectStore(TPerson); AssertSame(TPerson, vReturnValue.ObjectClass); end; initialization // Register any test cases with the test runner {$IFNDEF CURR_TESTS} RegisterTests([TestTInstantObjectStore, TestTInstantObjectStores]); {$ENDIF} end. --- NEW FILE: TestInstantParts.pas --- (* * InstantObjects Test Suite * TestInstantParts *) (* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is: InstantObjects Test Suite/TestInstantParts * * The Initial Developer of the Original Code is: Steven Mitchell * * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * * ***** END LICENSE BLOCK ***** *) unit TestInstantParts; interface uses fpcunit, InstantPersistence, InstantMock, TestModel; type // Test methods for class TInstantParts TestTInstantExtParts = class(TTestCase) private FConn: TInstantMockConnector; FInstantParts: TInstantParts; FOwner: TContact; function PartsExternalCompare(Holder, Obj1, Obj2: TInstantObject): Integer; public procedure SetUp; override; procedure TearDown; override; published procedure TestAdd; procedure TestAssign; procedure TestAttachObject; procedure TestClear; procedure TestDelete; procedure TestUnchanged; procedure TestDestroyObject; procedure TestDetachObject; procedure TestExchange; procedure TestHasItem; procedure TestIndexOf_Insert; procedure TestIndexOfInstance; procedure TestMove; procedure TestRemove; procedure TestReset; procedure TestSaveObjectsTo_FromStream; procedure TestSort; end; TestTinstantEmbParts = class(TTestCase) private FConn: TInstantMockConnector; FInstantParts: TInstantParts; FOwner: TContact; function PartsEmbeddedCompare(Holder, Obj1, Obj2: TInstantObject): Integer; public procedure SetUp; override; procedure TearDown; override; published procedure TestAdd; procedure TestAssign; procedure TestAttachObject; procedure TestClear; procedure TestDelete; procedure TestDetachObject; procedure TestExchange; procedure TestHasItem_DestroyObject; procedure TestIndexOfInstance; procedure TestIndexOf_Insert; procedure TestMove; procedure TestRemove; procedure TestReset; procedure TestSaveObjectsTo_FromStream; procedure TestSort; procedure TestUnchanged; end; TestTInstantParts_Leak = class(TTestCase) private FConn: TInstantMockConnector; FInstantParts: TInstantParts; FOwner: TContact; public procedure SetUp; override; procedure TearDown; override; published procedure TestAddEmbeddedObject; procedure TestAddExternalObject; end; implementation uses SysUtils, Classes, testregistry; procedure TestTInstantExtParts.SetUp; var i: Integer; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FOwner := TContact.Create(FConn); FInstantParts := FOwner._ExternalParts; for i := 0 to 2 do FOwner.AddExternalPart(TPartsExternal.Create(FConn)); AssertEquals('Setup FInstantParts.Count', 3, FInstantParts.Count); end; function TestTInstantExtParts.PartsExternalCompare(Holder, Obj1, Obj2: TInstantObject): Integer; var vObj1, vObj2: TPartsExternal; begin vObj1 := Obj1 as TPartsExternal; vObj2 := Obj2 as TPartsExternal; Result := AnsiCompareText(vObj1.Name, vObj2.Name); end; procedure TestTInstantExtParts.TearDown; begin FInstantParts.Clear; FInstantParts := nil; FreeAndNil(FOwner); InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTInstantExtParts.TestAdd; var vReturnValue: Integer; vExternalPart: TPartsExternal; begin vExternalPart := TPartsExternal.Create(FConn); vReturnValue := FInstantParts.Add(vExternalPart); AssertTrue(vReturnValue <> -1); AssertEquals(4, FInstantParts.Count); end; procedure TestTInstantExtParts.TestAssign; var vSource: TInstantParts; vAttrMetadata: TInstantAttributeMetadata; begin vSource := nil; vAttrMetadata := TInstantAttributeMetadata.Create(nil); try vAttrMetadata.AttributeClass := TInstantParts; vSource := TInstantParts.Create(FOwner, vAttrMetadata); AssertTrue(vSource.Count = 0); vSource.Assign(FInstantParts); AssertTrue(vSource.Count = 3); AssertNotSame(FInstantParts.Items[0], vSource.Items[0]); finally vSource.Free; vAttrMetadata.Free; end; end; procedure TestTInstantExtParts.TestAttachObject; var vReturnValue: Boolean; vExternalPart: TPartsExternal; begin vExternalPart := TPartsExternal.Create(FConn); vReturnValue := FInstantParts.AttachObject(vExternalPart); AssertTrue(vReturnValue); AssertEquals(4, FInstantParts.Count); end; procedure TestTInstantExtParts.TestClear; begin FInstantParts.Clear; AssertEquals(0, FInstantParts.Count); end; procedure TestTInstantExtParts.TestDelete; begin FInstantParts.Delete(1); AssertEquals(2, FInstantParts.Count); end; procedure TestTInstantExtParts.TestDestroyObject; begin AssertTrue(FInstantParts.HasItem(1)); FInstantParts.DestroyObject(1); AssertFalse(FInstantParts.HasItem(1)); end; procedure TestTInstantExtParts.TestDetachObject; var vReturnValue: Boolean; begin vReturnValue := FInstantParts.DetachObject(FInstantParts.Items[1]); AssertTrue(vReturnValue); AssertEquals(2, FInstantParts.Count); end; procedure TestTInstantExtParts.TestExchange; begin TPartsExternal(FInstantParts.Items[0]).Name := 'Part0'; TPartsExternal(FInstantParts.Items[1]).Name := 'Part1'; TPartsExternal(FInstantParts.Items[2]).Name := 'Part2'; FInstantParts.Exchange(0, 2); AssertEquals('Part2', TPartsExternal(FInstantParts.Items[0]).Name); AssertEquals('Part1', TPartsExternal(FInstantParts.Items[1]).Name); AssertEquals('Part0', TPartsExternal(FInstantParts.Items[2]).Name); end; procedure TestTInstantExtParts.TestHasItem; var vReturnValue: Boolean; begin vReturnValue := FInstantParts.HasItem(1); AssertTrue(vReturnValue); FInstantParts.DestroyObject(1); vReturnValue := FInstantParts.HasItem(1); AssertFalse(vReturnValue); end; procedure TestTInstantExtParts.TestIndexOf_Insert; var vReturnValue: Integer; vObject: TInstantObject; begin vObject := TPartsExternal.Create(FConn); FInstantParts.Insert(1, vObject); vReturnValue := FInstantParts.IndexOf(vObject); AssertEquals(1, vReturnValue); end; procedure TestTInstantExtParts.TestIndexOfInstance; var vReturnValue: Integer; vInstance: Pointer; begin vInstance := TPartsExternal.Create(FConn); FInstantParts.Insert(1, vInstance); vReturnValue := FInstantParts.IndexOfInstance(vInstance); AssertEquals(1, vReturnValue); end; procedure TestTInstantExtParts.TestMove; var vExternalPart: TPartsExternal; begin TPartsExternal(FInstantParts.Items[0]).Name := 'Part0'; TPartsExternal(FInstantParts.Items[1]).Name := 'Part1'; TPartsExternal(FInstantParts.Items[2]).Name := 'Part2'; vExternalPart := TPartsExternal.Create(FConn); FInstantParts.Add(vExternalPart); TPartsExternal(FInstantParts.Items[3]).Name := 'Part3'; FInstantParts.Move(0, 2); AssertEquals('Part1', TPartsExternal(FInstantParts.Items[0]).Name); AssertEquals('Part2', TPartsExternal(FInstantParts.Items[1]).Name); AssertEquals('Part0', TPartsExternal(FInstantParts.Items[2]).Name); AssertEquals('Part3', TPartsExternal(FInstantParts.Items[3]).Name); end; procedure TestTInstantExtParts.TestRemove; var vReturnValue: Integer; begin vReturnValue := FInstantParts.Remove(FInstantParts.Items[1]); AssertEquals(1, vReturnValue); AssertEquals(2, FInstantParts.Count); end; procedure TestTInstantExtParts.TestReset; begin FInstantParts.Reset; AssertEquals(0, FInstantParts.Count); end; procedure TestTInstantExtParts.TestSaveObjectsTo_FromStream; var vStream: TStream; begin vStream := TMemoryStream.Create; try AssertEquals(0, vStream.Size); FInstantParts.SaveObjectsToStream(vStream); AssertTrue(vStream.Size > 0); FInstantParts.Clear; AssertEquals(0, FInstantParts.Count); vStream.Position := 0; FInstantParts.LoadObjectsFromStream(vStream); AssertEquals(3, FInstantParts.Count); finally vStream.Free; end; end; procedure TestTInstantExtParts.TestSort; var vExternalPart: TPartsExternal; begin TPartsExternal(FInstantParts.Items[0]).Name := '2 Part'; TPartsExternal(FInstantParts.Items[1]).Name := '0 Part'; TPartsExternal(FInstantParts.Items[2]).Name := '1 Part'; vExternalPart := TPartsExternal.Create(FConn); FOwner.AddExternalPart(vExternalPart); TPartsExternal(FInstantParts.Items[3]).Name := '0 Part'; FInstantParts.Sort(PartsExternalCompare); AssertEquals('0 Part', TPartsExternal(FInstantParts.Items[0]).Name); AssertEquals('0 Part', TPartsExternal(FInstantParts.Items[1]).Name); AssertEquals('1 Part', TPartsExternal(FInstantParts.Items[2]).Name); AssertEquals('2 Part', TPartsExternal(FInstantParts.Items[3]).Name); end; procedure TestTInstantExtParts.TestUnchanged; begin AssertEquals(3, FInstantParts.Count); AssertTrue(FInstantParts.IsChanged); FInstantParts.Unchanged; AssertFalse(FInstantParts.IsChanged); TPartsExternal(FInstantParts.Items[1]).Name := 'Part2'; AssertTrue(FInstantParts.IsChanged); end; { TestTinstantEmbParts } function TestTinstantEmbParts.PartsEmbeddedCompare(Holder, Obj1, Obj2: TInstantObject): Integer; var vObj1, vObj2: TPhone; begin vObj1 := Obj1 as TPhone; vObj2 := Obj2 as TPhone; Result := AnsiCompareText(vObj1.Name, vObj2.Name); end; procedure TestTinstantEmbParts.SetUp; var i: Integer; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FOwner := TContact.Create(FConn); FInstantParts := FOwner._Phones; for i := 0 to 2 do FOwner.AddPhone(TPhone.Create(FConn)); AssertEquals('Setup FInstantParts.Count', 3, FInstantParts.Count); end; procedure TestTinstantEmbParts.TearDown; begin FInstantParts.Clear; FInstantParts := nil; FreeAndNil(FOwner); InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTinstantEmbParts.TestAdd; var vReturnValue: Integer; vPhone: TPhone; begin vPhone := TPhone.Create(FConn); vReturnValue := FInstantParts.Add(vPhone); AssertTrue(vReturnValue <> -1); AssertEquals(4, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestAssign; var vSource: TInstantParts; vAttrMetadata: TInstantAttributeMetadata; begin vSource := nil; vAttrMetadata := TInstantAttributeMetadata.Create(nil); try vAttrMetadata.AttributeClass := TInstantParts; vSource := TInstantParts.Create(FOwner, vAttrMetadata); AssertTrue(vSource.Count = 0); vSource.Assign(FInstantParts); AssertTrue(vSource.Count = 3); AssertNotSame(FInstantParts.Items[0], vSource.Items[0]); finally vSource.Free; vAttrMetadata.Free; end; end; procedure TestTinstantEmbParts.TestAttachObject; var vReturnValue: Boolean; vPhone: TPhone; begin vPhone := TPhone.Create(FConn); vReturnValue := FInstantParts.AttachObject(vPhone); AssertTrue(vReturnValue); AssertEquals(4, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestClear; begin FInstantParts.Clear; AssertEquals(0, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestDelete; begin FInstantParts.Delete(1); AssertEquals(2, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestDetachObject; var vReturnValue: Boolean; begin vReturnValue := FInstantParts.DetachObject(FInstantParts.Items[1]); AssertTrue(vReturnValue); AssertEquals(2, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestExchange; begin TPhone(FInstantParts.Items[0]).Name := 'Part0'; TPhone(FInstantParts.Items[1]).Name := 'Part1'; TPhone(FInstantParts.Items[2]).Name := 'Part2'; FInstantParts.Exchange(0, 2); AssertEquals('Part2', TPhone(FInstantParts.Items[0]).Name); AssertEquals('Part1', TPhone(FInstantParts.Items[1]).Name); AssertEquals('Part0', TPhone(FInstantParts.Items[2]).Name); end; procedure TestTinstantEmbParts.TestHasItem_DestroyObject; var vReturnValue: Boolean; begin vReturnValue := FInstantParts.HasItem(1); AssertTrue('Initial', vReturnValue); // This should do nothing for embedded parts FInstantParts.DestroyObject(1); vReturnValue := FInstantParts.HasItem(1); AssertTrue('After', vReturnValue); end; procedure TestTinstantEmbParts.TestIndexOfInstance; var vReturnValue: Integer; vInstance: Pointer; begin vInstance := TPhone.Create(FConn); FInstantParts.Insert(1, vInstance); vReturnValue := FInstantParts.IndexOfInstance(vInstance); AssertEquals(1, vReturnValue); end; procedure TestTinstantEmbParts.TestIndexOf_Insert; var vReturnValue: Integer; vObject: TInstantObject; begin vObject := TPhone.Create(FConn); FInstantParts.Insert(1, vObject); vReturnValue := FInstantParts.IndexOf(vObject); AssertEquals(1, vReturnValue); end; procedure TestTinstantEmbParts.TestMove; var vPhone: TPhone; begin TPhone(FInstantParts.Items[0]).Name := 'Part0'; TPhone(FInstantParts.Items[1]).Name := 'Part1'; TPhone(FInstantParts.Items[2]).Name := 'Part2'; vPhone := TPhone.Create(FConn); FInstantParts.Add(vPhone); TPhone(FInstantParts.Items[3]).Name := 'Part3'; FInstantParts.Move(0, 2); AssertEquals('Part1', TPhone(FInstantParts.Items[0]).Name); AssertEquals('Part2', TPhone(FInstantParts.Items[1]).Name); AssertEquals('Part0', TPhone(FInstantParts.Items[2]).Name); AssertEquals('Part3', TPhone(FInstantParts.Items[3]).Name); end; procedure TestTinstantEmbParts.TestRemove; var vReturnValue: Integer; begin vReturnValue := FInstantParts.Remove(FInstantParts.Items[1]); AssertEquals(1, vReturnValue); AssertEquals(2, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestReset; begin FInstantParts.Reset; AssertEquals(0, FInstantParts.Count); end; procedure TestTinstantEmbParts.TestSaveObjectsTo_FromStream; var vStream: TStream; begin vStream := TMemoryStream.Create; try AssertEquals(0, vStream.Size); FInstantParts.SaveObjectsToStream(vStream); AssertTrue(vStream.Size > 0); FInstantParts.Clear; AssertEquals(0, FInstantParts.Count); vStream.Position := 0; FInstantParts.LoadObjectsFromStream(vStream); AssertEquals(3, FInstantParts.Count); finally vStream.Free; end; end; procedure TestTinstantEmbParts.TestSort; var vPhone: TPhone; begin TPhone(FInstantParts.Items[0]).Name := '2 Part'; TPhone(FInstantParts.Items[1]).Name := '0 Part'; TPhone(FInstantParts.Items[2]).Name := '1 Part'; vPhone := TPhone.Create(FConn); FInstantParts.Add(vPhone); TPhone(FInstantParts.Items[3]).Name := '0 Part'; FInstantParts.Sort(PartsEmbeddedCompare); AssertEquals('0 Part', TPhone(FInstantParts.Items[0]).Name); AssertEquals('0 Part', TPhone(FInstantParts.Items[1]).Name); AssertEquals('1 Part', TPhone(FInstantParts.Items[2]).Name); AssertEquals('2 Part', TPhone(FInstantParts.Items[3]).Name); end; procedure TestTinstantEmbParts.TestUnchanged; begin AssertEquals(3, FInstantParts.Count); AssertTrue(FInstantParts.IsChanged); FInstantParts.Unchanged; AssertFalse(FInstantParts.IsChanged); TPartsExternal(FInstantParts.Items[1]).Name := 'Part2'; AssertTrue(FInstantParts.IsChanged); end; procedure TestTInstantParts_Leak.SetUp; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FOwner := TContact.Create(FConn); end; procedure TestTInstantParts_Leak.TearDown; begin FInstantParts.Clear; FInstantParts := nil; FreeAndNil(FOwner); InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTInstantParts_Leak.TestAddEmbeddedObject; var vReturnValue: Integer; vPart: TPhone; begin FInstantParts := FOwner._Phones; vPart := TPhone.Create(FConn); AssertEquals(1, vPart.RefCount); vReturnValue := FInstantParts.Add(vPart); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantParts.Count 1', 1, FInstantParts.Count); AssertEquals('vPart.RefCount 1', 1, vPart.RefCount); vReturnValue := FInstantParts.Remove(vPart); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantParts.Count 2', 0, FInstantParts.Count); // AssertException(EAccessViolation, vPart.Free); end; procedure TestTInstantParts_Leak.TestAddExternalObject; var vReturnValue: Integer; vPart: TPartsExternal; begin FInstantParts := FOwner._ExternalParts; vPart := TPartsExternal.Create(FConn); AssertEquals(1, vPart.RefCount); vReturnValue := FInstantParts.Add(vPart); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantParts.Count 1', 1, FInstantParts.Count); AssertEquals('vPart.RefCount 1', 1, vPart.RefCount); vReturnValue := FInstantParts.Remove(vPart); AssertTrue(vReturnValue <> -1); AssertEquals('FInstantParts.Count 2', 0, FInstantParts.Count); // AssertEquals('vPart.RefCount 2', 1, vPart.RefCount); // AssertException(EAccessViolation, vPart.Free); end; initialization // Register any test cases with the test runner {$IFNDEF CURR_TESTS} RegisterTests([TestTInstantExtParts, TestTinstantEmbParts, TestTInstantParts_Leak]); {$ELSE} RegisterTests([ TestTInstantExtParts, TestTinstantEmbParts, TestTInstantParts_Leak ]); {$ENDIF} end. --- NEW FILE: TestInstantCache.pas --- (* * InstantObjects Test Suite * TestInstantCache *) (* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is: InstantObjects Test Suite/TestInstantCache * * The Initial Developer of the Original Code is: Steven Mitchell * * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * * ***** END LICENSE BLOCK ***** *) unit TestInstantCache; interface uses fpcunit, InstantPersistence, InstantMock, TestModel; type // Test methods for class TInstantCache. // TInstantCacheNode and TInstantCacheEnumerator // are not tested seperately as they are only used // internally by TInstantCache. TestTInstantCache = class(TTestCase) private FConn: TInstantMockConnector; FInstantCache: TInstantCache; procedure InitSalary(aPerson: TInstantObject); public procedure SetUp; override; procedure TearDown; override; published procedure TestAdd_Remove; procedure TestFind_Clear; procedure TestForEach; end; implementation uses SysUtils, testregistry, InstantClasses; procedure TestTInstantCache.SetUp; begin FConn := TInstantMockConnector.Create(nil); FConn.BrokerClass := TInstantMockBroker; if InstantModel.ClassMetadatas.Count > 0 then InstantModel.ClassMetadatas.Clear; InstantModel.LoadFromResFile(ChangeFileExt(ParamStr(0), '.mdr')); FInstantCache := TInstantCache.Create; end; procedure TestTInstantCache.TearDown; begin FreeAndNil(FInstantCache); InstantModel.ClassMetadatas.Clear; FreeAndNil(FConn); end; procedure TestTInstantCache.TestAdd_Remove; var vPerson: TPerson; begin AssertEquals(0, FInstantCache.Count); vPerson := TPerson.Create(FConn); try AssertNotNull(vPerson); vPerson.Name := 'AName'; vPerson.Store; FInstantCache.Add(vPerson); AssertEquals(1, FInstantCache.Count); AssertEquals('AName', TPerson(FInstantCache.Items[0]).Name); // Should not allow duplicate objects in cache FInstantCache.Add(vPerson); AssertEquals(1, FInstantCache.Count); FInstantCache.Remove(vPerson); AssertEquals(0, FInstantCache.Count); finally vPerson.Free; end; end; procedure TestTInstantCache.TestFind_Clear; var vPerId: string; vPerson1: TPerson; vPerson2: TPerson; vPerson3: TPerson; vReturnValue: TPerson; begin vPerson2 := nil; vPerson3 := nil; AssertEquals(0, FInstantCache.Count); vPerson1 := TPerson.Create(FConn); try AssertNotNull(vPerson1); vPerson1.Name := 'AName_1'; vPerson1.Store; FInstantCache.Add(vPerson1); AssertEquals(1, FInstantCache.Count); vPerson2 := TPerson.Create(FConn); AssertNotNull(vPerson2); vPerson2.Name := 'AName_2'; vPerson2.Store; vPerId := vPerson2.PersistentId; FInstantCache.Add(vPerson2); AssertEquals(2, FInstantCache.Count); vPerson3 := TPerson.Create(FConn); AssertNotNull(vPerson3); vPerson3.Name := 'AName_3'; vPerson3.Store; FInstantCache.Add(vPerson3); AssertEquals(3, FInstantCache.Count); vReturnValue := TPerson(FInstantCache.Find(vPerId)); AssertEquals('AName_2', vReturnValue.Name); FInstantCache.Clear; AssertEquals(0, FInstantCache.Count); finally vPerson1.Free; vPerson2.Free; vPerson3.Free; end; end; procedure TestTInstantCache.InitSalary(aPerson: TInstantObject); begin with aPerson as TPerson do Salary := 55000; end; procedure TestTInstantCache.TestForEach; var vPerson1: TPerson; vPerson2: TPerson; vPerson3: TPerson; i: Integer; begin vPerson2 := nil; vPerson3 := nil; AssertEquals(0, FInstantCache.Count); vPerson1 := TPerson.Create(FConn); try AssertNotNull(vPerson1); vPerson1.Name := 'AName_1'; vPerson1.Store; FInstantCache.Add(vPerson1); AssertEquals(1, FInstantCache.Count); vPerson2 := TPerson.Create(FConn); AssertNotNull(vPerson2); vPerson2.Name := 'AName_2'; vPerson2.Store; FInstantCache.Add(vPerson2); AssertEquals(2, FInstantCache.Count); vPerson3 := TPerson.Create(FConn); AssertNotNull(vPerson3); vPerson3.Name := 'AName_3'; vPerson3.Store; FInstantCache.Add(vPerson3); AssertEquals(3, FInstantCache.Count); FInstantCache.ForEach(InitSalary); for i := 0 to Pred(FInstantCache.Count) do AssertEquals(55000, TPerson(FInstantCache.Items[i]).Salary); FInstantCache.Clear; AssertEquals(0, FInstantCache.Count); finally vPerson1.Free; vPerson2.Free; vPerson3.Free; end; end; initialization // Register any test cases with the test runner {$IFNDEF CURR_TESTS} RegisterTests([TestTInstantCache]); {$ENDIF} end. |
From: Steven M. <sr...@us...> - 2005-10-18 03:14:25
|
Update of /cvsroot/instantobjects/Demos/PrimerCross/ModelExternal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12873 Modified Files: Model.pas Log Message: Update to mimimise (eliminate) object leakage when generating data due to circular references between Person.Employer and Company.Employees. Index: Model.pas =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/ModelExternal/Model.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Model.pas 1 Mar 2005 05:37:44 -0000 1.4 --- Model.pas 18 Oct 2005 03:14:17 -0000 1.5 *************** *** 353,392 **** end; var OldEmployer: TCompany; begin OldEmployer := Employer; ! AddRef; try ! Connector.StartTransaction; try ! AddToEmployer(NewEmployer); try ! StoreEmployer(NewEmployer); ! RemoveFromEmployer(OldEmployer); try ! StoreEmployer(OldEmployer); ! _Employer.Value := NewEmployer; ! try ! Store; ! Connector.CommitTransaction; ! except ! _Employer.Value := OldEmployer; ! raise; ! end; except ! AddToEmployer(OldEmployer); raise; end; except ! RemoveFromEmployer(NewEmployer); raise; end; except ! Connector.RollbackTransaction; raise; end; ! finally ! Free; end; end; --- 353,394 ---- end; + procedure ReferenceEmployer(AEmployer: TCompany); + begin + _Employer.Reset; + if Assigned(AEmployer) then + _Employer.ReferenceObject(AEmployer.ClassType, AEmployer.Id); + end; + var OldEmployer: TCompany; begin OldEmployer := Employer; ! Connector.StartTransaction; try ! AddToEmployer(NewEmployer); try ! StoreEmployer(NewEmployer); ! RemoveFromEmployer(OldEmployer); try ! StoreEmployer(OldEmployer); ! ReferenceEmployer(NewEmployer); try ! Store; ! Connector.CommitTransaction; except ! ReferenceEmployer(OldEmployer); raise; end; except ! AddToEmployer(OldEmployer); raise; end; except ! RemoveFromEmployer(NewEmployer); raise; end; ! except ! Connector.RollbackTransaction; ! raise; end; end; *************** *** 399,403 **** function TPerson.GetEmailCount: Integer; begin ! Result := _Emails.Count end; --- 401,405 ---- function TPerson.GetEmailCount: Integer; begin ! Result := _Emails.Count; end; *************** *** 599,603 **** function TContact.GetPhoneCount: Integer; begin ! Result := _Phones.Count end; --- 601,605 ---- function TContact.GetPhoneCount: Integer; begin ! Result := _Phones.Count; end; |
From: Steven M. <sr...@us...> - 2005-10-18 03:14:08
|
Update of /cvsroot/instantobjects/Demos/PrimerCross/Model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12822 Modified Files: Model.pas Log Message: Update to mimimise (eliminate) object leakage when generating data due to circular references between Person.Employer and Company.Employees. Index: Model.pas =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/Model/Model.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Model.pas 1 Mar 2005 05:37:30 -0000 1.3 --- Model.pas 18 Oct 2005 03:13:59 -0000 1.4 *************** *** 350,389 **** end; var OldEmployer: TCompany; begin OldEmployer := Employer; ! AddRef; try ! Connector.StartTransaction; try ! AddToEmployer(NewEmployer); try ! StoreEmployer(NewEmployer); ! RemoveFromEmployer(OldEmployer); try ! StoreEmployer(OldEmployer); ! _Employer.Value := NewEmployer; ! try ! Store; ! Connector.CommitTransaction; ! except ! _Employer.Value := OldEmployer; ! raise; ! end; except ! AddToEmployer(OldEmployer); raise; end; except ! RemoveFromEmployer(NewEmployer); raise; end; except ! Connector.RollbackTransaction; raise; end; ! finally ! Free; end; end; --- 350,391 ---- end; + procedure ReferenceEmployer(AEmployer: TCompany); + begin + _Employer.Reset; + if Assigned(AEmployer) then + _Employer.ReferenceObject(AEmployer.ClassType, AEmployer.Id); + end; + var OldEmployer: TCompany; begin OldEmployer := Employer; ! Connector.StartTransaction; try ! AddToEmployer(NewEmployer); try ! StoreEmployer(NewEmployer); ! RemoveFromEmployer(OldEmployer); try ! StoreEmployer(OldEmployer); ! ReferenceEmployer(NewEmployer); try ! Store; ! Connector.CommitTransaction; except ! ReferenceEmployer(OldEmployer); raise; end; except ! AddToEmployer(OldEmployer); raise; end; except ! RemoveFromEmployer(NewEmployer); raise; end; ! except ! Connector.RollbackTransaction; ! raise; end; end; *************** *** 702,706 **** function TCompany.AddEmployee(Employee: TPerson): Integer; begin ! Result := _Employees.Add(Employee) end; --- 704,708 ---- function TCompany.AddEmployee(Employee: TPerson): Integer; begin ! Result := _Employees.Add(Employee); end; *************** *** 717,721 **** function TCompany.GetEmployeeCount: Integer; begin ! Result := _Employees.Count end; --- 719,723 ---- function TCompany.GetEmployeeCount: Integer; begin ! Result := _Employees.Count; end; |
Update of /cvsroot/instantobjects/Source/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12339 Modified Files: TestIO.cfg TestIO.dof TestModel.pas TestMockBroker.pas TestIO.dpr TestInstantTableMetadata.pas TestInstantScheme.pas TestInstantReference.pas TestInstantPart.pas TestInstantObject.pas TestInstantElement.pas TestInstantClassMetadata.pas MinimalModel.pas InstantMock.pas TestIO.mdx TestIO.mdr TestIO.res Log Message: Update for unit tests. Index: TestMockBroker.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestMockBroker.pas,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TestMockBroker.pas 28 Jun 2005 03:45:50 -0000 1.10 --- TestMockBroker.pas 18 Oct 2005 03:10:19 -0000 1.11 *************** *** 137,141 **** procedure TTestMockBroker.TestStoreAndRetrieveAddress; var ! a: TAddress; old_id: string; brok: TInstantMockBroker; --- 137,141 ---- procedure TTestMockBroker.TestStoreAndRetrieveAddress; var ! a: TProject; old_id: string; brok: TInstantMockBroker; *************** *** 145,152 **** brok := FConn.Broker as TInstantMockBroker; brok.MockManager.StartSetUp; ! a := TAddress.Create; try ! a.City := 'Milan'; ! a.Store(); old_id := a.id; finally --- 145,152 ---- brok := FConn.Broker as TInstantMockBroker; brok.MockManager.StartSetUp; ! a := TProject.Create; try ! a.Name := 'Bongo'; ! a.Store; old_id := a.id; finally *************** *** 159,163 **** FConn.CommitTransaction; brok.MockManager.StartSetUp; ! a := TAddress.Retrieve(old_id); try AssertEquals(old_id, a.Id); --- 159,163 ---- FConn.CommitTransaction; brok.MockManager.StartSetUp; ! a := TProject.Retrieve(old_id); try AssertEquals(old_id, a.Id); Index: InstantMock.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/InstantMock.pas,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** InstantMock.pas 28 Jun 2005 03:45:50 -0000 1.7 --- InstantMock.pas 18 Oct 2005 03:10:19 -0000 1.8 *************** *** 34,38 **** uses ! SysUtils, InstantPersistence, Classes, UbMockObject; type --- 34,38 ---- uses ! SysUtils, DB, InstantPersistence, Classes, UbMockObject; type *************** *** 104,107 **** --- 104,174 ---- end; + TInstantMockRelationalConnector = class(TInstantRelationalConnector) + private + FBrokerClass: TInstantBrokerClass; + FMock: TUbMockObject; + procedure SetBrokerClass(const Value: TInstantBrokerClass); + protected + function CreateBroker: TInstantBroker; override; + procedure InternalCommitTransaction; override; + procedure InternalConnect; override; + function InternalCreateScheme(Model: TInstantModel): TInstantScheme; override; + procedure InternalDisconnect; override; + procedure InternalRollbackTransaction; override; + procedure InternalStartTransaction; override; + procedure SetMock(const Value: TUbMockObject); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + class function ConnectionDefClass: TInstantConnectionDefClass; override; + property BrokerClass: TInstantBrokerClass read FBrokerClass write + SetBrokerClass; + property MockManager: TUbMockObject read FMock write SetMock; + end; + + TInstantMockSQLBroker = class(TInstantSQLBroker) + private + FMock: TUbMockObject; + procedure SetMock(const Value: TUbMockObject); + protected + procedure AssignDataSetParams(DataSet : TDataSet; AParams: TParams); override; + function CreateDataSet(const AStatement: string; AParams: TParams = nil): + TDataSet; override; + function CreateResolver(Map: TInstantAttributeMap): TInstantSQLResolver; + override; + function EnsureResolver(Map: TInstantAttributeMap): TInstantCustomResolver; + override; + function InternalDisposeObject(AObject: TInstantObject; ConflictAction: + TInstantConflictAction): Boolean; override; + function InternalRetrieveObject(AObject: TInstantObject; const AObjectId: + String; ConflictAction: TInstantConflictAction): Boolean; override; + function InternalStoreObject(AObject: TInstantObject; ConflictAction: + TInstantConflictAction): Boolean; override; + public + constructor Create(AConnector: TInstantConnector); override; + destructor Destroy; override; + function DataTypeToColumnType(DataType: TInstantDataType; Size: Integer): + string; override; + property MockManager: TUbMockObject read FMock write SetMock; + end; + + TInstantMockDataset = class(TDataSet) + private + FMock: TUbMockObject; + procedure SetMock(const Value: TUbMockObject); + protected + function GetRecord(Buffer: PChar; GetMode: TGetMode; DoCheck: Boolean): + TGetResult; override; + procedure InternalClose; override; + procedure InternalHandleException; override; + procedure InternalInitFieldDefs; override; + procedure InternalOpen; override; + function IsCursorOpen: Boolean; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property MockManager: TUbMockObject read FMock write SetMock; + end; + implementation *************** *** 299,302 **** --- 366,574 ---- end; + constructor TInstantMockRelationalConnector.Create(AOwner: TComponent); + begin + inherited; + FMock := TUbMockObject.Create; + end; + + { TInstantMockBroker } + + destructor TInstantMockRelationalConnector.Destroy; + begin + FMock.Free; + inherited; + end; + + { TMockIConnector } + + class function TInstantMockRelationalConnector.ConnectionDefClass: + TInstantConnectionDefClass; + begin + result := TInstantMockConnectionDef; + end; + + function TInstantMockRelationalConnector.CreateBroker: TInstantBroker; + begin + if not Assigned(FBrokerClass) then + raise Exception.Create('Undefined BrokerClass'); + FMock.AddExpectation('CreateBroker ' + FBrokerClass.ClassName); + Result := FBrokerClass.Create(Self); + end; + + procedure TInstantMockRelationalConnector.InternalCommitTransaction; + begin + inherited; + FMock.AddExpectation('InternalCommitTransaction'); + end; + + procedure TInstantMockRelationalConnector.InternalConnect; + begin + FMock.AddExpectation('InternalConnect'); + end; + + function TInstantMockRelationalConnector.InternalCreateScheme(Model: + TInstantModel): TInstantScheme; + begin + FMock.AddExpectation('InternalCreateScheme'); + Result := TInstantScheme.Create; + Result.Catalog := TInstantModelCatalog.Create(Result, Model); + end; + + procedure TInstantMockRelationalConnector.InternalDisconnect; + begin + FMock.AddExpectation('InternalDisconnect'); + end; + + procedure TInstantMockRelationalConnector.InternalRollbackTransaction; + begin + inherited; + FMock.AddExpectation('InternalRollbackTransaction'); + end; + + procedure TInstantMockRelationalConnector.InternalStartTransaction; + begin + inherited; + FMock.AddExpectation('InternalStartTransaction'); + end; + + procedure TInstantMockRelationalConnector.SetBrokerClass(const Value: + TInstantBrokerClass); + begin + FBrokerClass := Value; + end; + + procedure TInstantMockRelationalConnector.SetMock(const Value: TUbMockObject); + begin + FMock := Value; + end; + + { TInstantMockCRBroker } + + constructor TInstantMockSQLBroker.Create(AConnector: TInstantConnector); + begin + inherited; + FMock := TUbMockObject.Create; + end; + + destructor TInstantMockSQLBroker.Destroy; + begin + FMock.Free; + inherited; + end; + + procedure TInstantMockSQLBroker.AssignDataSetParams(DataSet : TDataSet; + AParams: TParams); + begin + MockManager.AddExpectation('AssignDataSetParams'); + end; + + function TInstantMockSQLBroker.CreateDataSet(const AStatement: string; AParams: + TParams = nil): TDataSet; + begin + MockManager.AddExpectation('CreateDataSet'); + // Result := nil; + Result := TInstantMockDataset.Create(nil); + end; + + function TInstantMockSQLBroker.CreateResolver(Map: TInstantAttributeMap): + TInstantSQLResolver; + begin + MockManager.AddExpectation('CreateResolver'); + Result := nil; + end; + + function TInstantMockSQLBroker.DataTypeToColumnType(DataType: TInstantDataType; + Size: Integer): string; + begin + MockManager.AddExpectation('DataTypeToColumnType'); + Result := ''; + end; + + function TInstantMockSQLBroker.EnsureResolver(Map: TInstantAttributeMap): + TInstantCustomResolver; + begin + MockManager.AddExpectation('EnsureResolver'); + Result := nil; + end; + + function TInstantMockSQLBroker.InternalDisposeObject(AObject: TInstantObject; + ConflictAction: TInstantConflictAction): Boolean; + begin + Result := True; + MockManager.AddExpectation('InternalDisposeObject ' + CaToStr(ConflictAction) + ' ' + AObject.Id); + end; + + function TInstantMockSQLBroker.InternalRetrieveObject(AObject: TInstantObject; + const AObjectId: String; ConflictAction: TInstantConflictAction): Boolean; + begin + Result := True; + MockManager.AddExpectation('InternalRetrieveObject ' + CaToStr(ConflictAction) + ' ' + AObjectId); + end; + + function TInstantMockSQLBroker.InternalStoreObject(AObject: TInstantObject; + ConflictAction: TInstantConflictAction): Boolean; + begin + Result := True; + MockManager.AddExpectation('InternalStoreObject ' + CaToStr(ConflictAction) + ' ' + AObject.Id); + end; + + procedure TInstantMockSQLBroker.SetMock(const Value: TUbMockObject); + begin + FMock := Value; + end; + + { TInstantMockCRBroker } + + constructor TInstantMockDataset.Create(AOwner: TComponent); + begin + inherited; + FMock := TUbMockObject.Create; + end; + + destructor TInstantMockDataset.Destroy; + begin + FMock.Free; + inherited; + end; + + function TInstantMockDataset.GetRecord(Buffer: PChar; GetMode: TGetMode; + DoCheck: Boolean): TGetResult; + begin + MockManager.AddExpectation('GetRecord'); + Result := grError; + end; + + procedure TInstantMockDataset.InternalClose; + begin + MockManager.AddExpectation('InternalClose'); + end; + + procedure TInstantMockDataset.InternalHandleException; + begin + raise Exception.Create('Exception raised in InternalHandleException'); + end; + + procedure TInstantMockDataset.InternalInitFieldDefs; + begin + raise Exception.Create('Exception raised in InternalInitFieldDefs'); + MockManager.AddExpectation('InternalInitFieldDefs'); + end; + + procedure TInstantMockDataset.InternalOpen; + begin + MockManager.AddExpectation('InternalOpen'); + end; + + function TInstantMockDataset.IsCursorOpen: Boolean; + begin + MockManager.AddExpectation('IsCursorOpen'); + Result := False; + end; + + procedure TInstantMockDataset.SetMock(const Value: TUbMockObject); + begin + FMock := Value; + end; + initialization RegisterClass(TInstantMockConnectionDef); Index: TestIO.res =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.res,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsVadMZ8 and /tmp/cvsS0mog5 differ Index: TestInstantScheme.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantScheme.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestInstantScheme.pas 28 Jun 2005 03:45:50 -0000 1.6 --- TestInstantScheme.pas 18 Oct 2005 03:10:19 -0000 1.7 *************** *** 109,114 **** procedure TestTInstantScheme.TestTableMetadataCount; begin ! AssertEquals(8, FInstantScheme.TableMetadataCount); end; --- 109,119 ---- procedure TestTInstantScheme.TestTableMetadataCount; + var + vCnt: Integer; begin ! AssertTrue(FInstantScheme.TableMetadataCount > 0); ! // Test number of ClassMetadatas against number of TableMetadatas ! vCnt := FInstantScheme.TableMetadatas[0].Collection.Count; ! AssertEquals(vCnt, FInstantScheme.TableMetadataCount); end; *************** *** 119,123 **** vReturnValue := FInstantScheme.TableMetadatas[0]; AssertNotNull(vReturnValue); ! AssertEquals('Address', vReturnValue.Name); end; --- 124,128 ---- vReturnValue := FInstantScheme.TableMetadatas[0]; AssertNotNull(vReturnValue); ! AssertEquals('Country', vReturnValue.Name); end; Index: TestInstantClassMetadata.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantClassMetadata.pas,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestInstantClassMetadata.pas 28 Jun 2005 03:45:51 -0000 1.5 --- TestInstantClassMetadata.pas 18 Oct 2005 03:10:19 -0000 1.6 *************** *** 124,134 **** procedure TestTInstantClassMetadata.TestCollection; begin // Collection property contains all of the class metadatas in the model AssertNotNull(FInstantClassMetadata.Collection); ! AssertEquals(9, FInstantClassMetadata.Collection.Count); FInstantClassMetadata := InstantModel.ClassMetadatas.Find('TPhone'); ! AssertEquals(9, FInstantClassMetadata.Collection.Count); end; --- 124,136 ---- procedure TestTInstantClassMetadata.TestCollection; + var + vCnt: Integer; begin // Collection property contains all of the class metadatas in the model AssertNotNull(FInstantClassMetadata.Collection); ! vCnt := FInstantClassMetadata.Collection.Count; FInstantClassMetadata := InstantModel.ClassMetadatas.Find('TPhone'); ! AssertEquals(vCnt, FInstantClassMetadata.Collection.Count); end; *************** *** 227,236 **** var vReturnValue: TInstantClassMetadata; begin vReturnValue := FInstantClassMetadatas.Add; AssertNotNull(vReturnValue); ! AssertEquals(10, FInstantClassMetadatas.Count); FInstantClassMetadatas.Remove(vReturnValue); ! AssertEquals(9, FInstantClassMetadatas.Count); end; --- 229,240 ---- var vReturnValue: TInstantClassMetadata; + vCnt: Integer; begin + vCnt := FInstantClassMetadatas.Count; vReturnValue := FInstantClassMetadatas.Add; AssertNotNull(vReturnValue); ! AssertEquals(vCnt + 1, FInstantClassMetadatas.Count); FInstantClassMetadatas.Remove(vReturnValue); ! AssertEquals(vCnt, FInstantClassMetadatas.Count); end; Index: TestInstantObject.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantObject.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestInstantObject.pas 28 Jun 2005 03:45:46 -0000 1.4 --- TestInstantObject.pas 18 Oct 2005 03:10:19 -0000 1.5 *************** *** 180,183 **** --- 180,187 ---- vSource := TPerson.Create(FConn); try + { NOTE: vSource.Category is not assigned here so that + the leakage, etc. behaviour of an unassigned reference + attribute can be monitored during assign and clone + operations. } AssertNotNull(vSource); vSource.Name := 'NewPerson'; *************** *** 191,194 **** --- 195,199 ---- AssertEquals('InitPerson', FInstantObject.Name); FInstantObject.Assign(vSource); + vSource._Employer.DestroyObject; AssertEquals('NewPerson', FInstantObject.Name); AssertEquals(1, FInstantObject.EmailCount); *************** *** 196,200 **** AssertEquals('Employer Co.', FInstantObject.Employer.Name); ! vClone := TPerson(FInstantObject.Clone(FConn)); AssertNotNull(vClone); AssertNotSame(vClone, FInstantObject); --- 201,205 ---- AssertEquals('Employer Co.', FInstantObject.Employer.Name); ! vClone := TPerson.Clone(FInstantObject, FConn); AssertNotNull(vClone); AssertNotSame(vClone, FInstantObject); *************** *** 209,213 **** AssertNull(FInstantObject.Employer); finally - vCompany.ClearEmployees; vCompany.Free; vSource.Free; --- 214,217 ---- *************** *** 442,446 **** AssertEquals('InstanceSize', TPerson.InstanceSize, vReturnValue.InstanceSize); finally ! vReturnValue.Free; end; end; --- 446,450 ---- AssertEquals('InstanceSize', TPerson.InstanceSize, vReturnValue.InstanceSize); finally ! vReturnValue.FreeInstance; end; end; *************** *** 514,518 **** var vPhone: TPhone; ! vAddress: TAddress; vContact: TContact; vID, vID1: String; --- 518,522 ---- var vPhone: TPhone; ! vPartExternal: TPartExternal; vContact: TContact; vID, vID1: String; *************** *** 528,532 **** vContact := TContact.Create(FConn); ! vAddress := TAddress.Create(FConn); try FConn.StartTransaction; --- 532,536 ---- vContact := TContact.Create(FConn); ! vPartExternal := TPartExternal.Create(FConn); try FConn.StartTransaction; *************** *** 534,543 **** brok.MockManager.EndSetUp; vContact.Name := 'MyContact'; ! vAddress.City := 'New York'; ! AssertTrue(vAddress.IsChanged); ! vAddress.Store; ! vID1 := vAddress.Id; ! vContact.AddressExt := vAddress; ! AssertEquals('vAddress', 1, vAddress.RefCount); AssertEquals('vContact.Address', 1, vContact.Address.RefCount); --- 538,547 ---- brok.MockManager.EndSetUp; vContact.Name := 'MyContact'; ! vPartExternal.Name := 'Part External'; ! AssertTrue(vPartExternal.IsChanged); ! vPartExternal.Store; ! vID1 := vPartExternal.Id; ! vContact.PartExternal := vPartExternal; ! AssertEquals('vPartExternal', 1, vPartExternal.RefCount); AssertEquals('vContact.Address', 1, vContact.Address.RefCount); *************** *** 555,561 **** AssertTrue('vContact.IsPersistent', vContact.IsPersistent); AssertFalse('vPhone.IsPersistent', vPhone.IsPersistent); ! AssertTrue('vAddress.IsPersistent', vAddress.IsPersistent); ! vAddress.City := 'London'; ! AssertTrue(vAddress.IsChanged); AssertTrue(vContact.IsChanged); vID := vContact.Id; --- 559,565 ---- AssertTrue('vContact.IsPersistent', vContact.IsPersistent); AssertFalse('vPhone.IsPersistent', vPhone.IsPersistent); ! AssertTrue('vPartExternal.IsPersistent', vPartExternal.IsPersistent); ! vPartExternal.Name := 'Changed'; ! AssertTrue(vPartExternal.IsChanged); AssertTrue(vContact.IsChanged); vID := vContact.Id; Index: TestIO.dof =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.dof,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestIO.dof 17 Oct 2005 10:05:08 -0000 1.6 --- TestIO.dof 18 Oct 2005 03:10:19 -0000 1.7 *************** *** 16,20 **** M=0 N=1 ! O=1 P=1 Q=0 --- 16,20 ---- M=0 N=1 ! O=0 P=1 Q=0 *************** *** 24,28 **** U=0 V=1 ! W=0 X=1 Y=1 --- 24,28 ---- U=0 V=1 ! W=1 X=1 Y=1 *************** *** 95,102 **** PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=..\Core Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;adortl;vclactnband;vclshlctrls;CS30Logging70;Rz30Ctls70;Rz30DBCtls70;ip4000v7;Rave60VCL;Rave60CLX;madBasic_;madDisAsm_;CLXIB;ibxpress;VCLIB;IOCore;IOIBX Conditionals= ! DebugSourceDirs= UsePackages=0 [Parameters] --- 95,102 ---- PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=D:\L\ubmock\src Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;adortl;vclactnband;vclshlctrls;CS30Logging70;Rz30Ctls70;Rz30DBCtls70;ip4000v7;Rave60VCL;Rave60CLX;madBasic_;madDisAsm_;CLXIB;ibxpress;VCLIB;IOCore;IOIBX Conditionals= ! DebugSourceDirs=D:\L\InstantObjects\Source\Core UsePackages=0 [Parameters] Index: TestModel.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestModel.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestModel.pas 28 Jun 2005 03:45:50 -0000 1.4 --- TestModel.pas 18 Oct 2005 03:10:19 -0000 1.5 *************** *** 44,53 **** TCountry = class; TEmail = class; TPerson = class; TPhone = class; TAddress = class(TInstantObject) ! {IOMETADATA stored; ! City: String(30) index; Country: Reference(TCountry); State: String(4); --- 44,55 ---- TCountry = class; TEmail = class; + TPartExternal = class; + TPartsExternal = class; TPerson = class; TPhone = class; + TProject = class; TAddress = class(TInstantObject) ! {IOMETADATA City: String(30) index; Country: Reference(TCountry); State: String(4); *************** *** 89,93 **** function GetCaption: string; override; published - property Id; property Name: string read GetName write SetName; end; --- 91,94 ---- *************** *** 140,166 **** Name: String(50) index; Phones: Parts(TPhone); ! AddressExt: Part(TAddress) stored 'Address' external; } _Address: TInstantPart; - _AddressExt: TInstantPart; _Category: TInstantReference; _City: TInstantString; _Name: TInstantString; _Phones: TInstantParts; private function GetAddress: TAddress; - function GetAddressExt: TAddress; function GetCategory: TCategory; function GetCity: string; function GetMainPhoneNumber: string; function GetName: string; function GetPhoneCount: Integer; function GetPhones(Index: Integer): TPhone; procedure SetAddress(Value: TAddress); - procedure SetAddressExt(Value: TAddress); procedure SetCategory(Value: TCategory); procedure SetCity(const Value: string); procedure SetMainPhoneNumber(const Value: string); procedure SetName(const Value: string); procedure SetPhones(Index: Integer; Value: TPhone); protected procedure AfterCreate; override; --- 141,177 ---- Name: String(50) index; Phones: Parts(TPhone); ! Projects: References(TProject) external 'Contact_Projects'; ! PartExternal: Part(TPartExternal) external; ! ExternalParts: Parts(TPartsExternal) external 'Contact_ExternalParts'; } _Address: TInstantPart; _Category: TInstantReference; _City: TInstantString; + _ExternalParts: TInstantParts; _Name: TInstantString; + _PartExternal: TInstantPart; _Phones: TInstantParts; + _Projects: TInstantReferences; private function GetAddress: TAddress; function GetCategory: TCategory; function GetCity: string; + function GetExternalPartCount: Integer; + function GetExternalParts(Index: Integer): TPartsExternal; function GetMainPhoneNumber: string; function GetName: string; + function GetPartExternal: TPartExternal; function GetPhoneCount: Integer; function GetPhones(Index: Integer): TPhone; + function GetProjectCount: Integer; + function GetProjects(Index: Integer): TProject; procedure SetAddress(Value: TAddress); procedure SetCategory(Value: TCategory); procedure SetCity(const Value: string); + procedure SetExternalParts(Index: Integer; Value: TPartsExternal); procedure SetMainPhoneNumber(const Value: string); procedure SetName(const Value: string); + procedure SetPartExternal(Value: TPartExternal); procedure SetPhones(Index: Integer; Value: TPhone); + procedure SetProjects(Index: Integer; Value: TProject); protected procedure AfterCreate; override; *************** *** 168,186 **** function GetCaption: string; override; public function AddPhone(Phone: TPhone): Integer; procedure ClearPhones; procedure DeletePhone(Index: Integer); function IndexOfPhone(Phone: TPhone): Integer; procedure InsertPhone(Index: Integer; Phone: TPhone); function RemovePhone(Phone: TPhone): Integer; property PhoneCount: Integer read GetPhoneCount; property Phones[Index: Integer]: TPhone read GetPhones write SetPhones; published property Address: TAddress read GetAddress write SetAddress; - property AddressExt: TAddress read GetAddressExt write SetAddressExt; property Category: TCategory read GetCategory write SetCategory; property City: string read GetCity write SetCity; ! property MainPhoneNumber: string read GetMainPhoneNumber write SetMainPhoneNumber; property Name: string read GetName write SetName; end; --- 179,215 ---- function GetCaption: string; override; public + function AddExternalPart(ExternalPart: TPartsExternal): Integer; function AddPhone(Phone: TPhone): Integer; + function AddProject(Project: TProject): Integer; + procedure ClearExternalParts; procedure ClearPhones; + procedure ClearProjects; + procedure DeleteExternalPart(Index: Integer); procedure DeletePhone(Index: Integer); + procedure DeleteProject(Index: Integer); + function IndexOfExternalPart(ExternalPart: TPartsExternal): Integer; function IndexOfPhone(Phone: TPhone): Integer; + function IndexOfProject(Project: TProject): Integer; + procedure InsertExternalPart(Index: Integer; ExternalPart: TPartsExternal); procedure InsertPhone(Index: Integer; Phone: TPhone); + procedure InsertProject(Index: Integer; Project: TProject); + function RemoveExternalPart(ExternalPart: TPartsExternal): Integer; function RemovePhone(Phone: TPhone): Integer; + function RemoveProject(Project: TProject): Integer; + property ExternalPartCount: Integer read GetExternalPartCount; + property ExternalParts[Index: Integer]: TPartsExternal read GetExternalParts write SetExternalParts; property PhoneCount: Integer read GetPhoneCount; property Phones[Index: Integer]: TPhone read GetPhones write SetPhones; + property ProjectCount: Integer read GetProjectCount; + property Projects[Index: Integer]: TProject read GetProjects + write SetProjects; published property Address: TAddress read GetAddress write SetAddress; property Category: TCategory read GetCategory write SetCategory; property City: string read GetCity write SetCity; ! property MainPhoneNumber: string read GetMainPhoneNumber ! write SetMainPhoneNumber; property Name: string read GetName write SetName; + property PartExternal: TPartExternal read GetPartExternal write SetPartExternal; end; *************** *** 275,278 **** --- 304,340 ---- end; + TProject = class(TInstantObject) + {IOMETADATA stored; + Name: String(30); } + _Name: TInstantString; + private + function GetName: string; + procedure SetName(const Value: string); + published + property Name: string read GetName write SetName; + end; + + TPartExternal = class(TInstantObject) + {IOMETADATA stored; + Name: String(30) default; } + _Name: TInstantString; + private + function GetName: string; + procedure SetName(const Value: string); + published + property Name: string read GetName write SetName; + end; + + TPartsExternal = class(TInstantObject) + {IOMETADATA stored; + Name: String; } + _Name: TInstantString; + private + function GetName: string; + procedure SetName(const Value: string); + published + property Name: string read GetName write SetName; + end; + implementation *************** *** 399,438 **** end; var OldEmployer: TCompany; begin OldEmployer := Employer; ! AddRef; try ! Connector.StartTransaction; try ! AddToEmployer(NewEmployer); try ! StoreEmployer(NewEmployer); ! RemoveFromEmployer(OldEmployer); try ! StoreEmployer(OldEmployer); ! _Employer.Value := NewEmployer; ! try ! Store; ! Connector.CommitTransaction; ! except ! _Employer.Value := OldEmployer; ! raise; ! end; except ! AddToEmployer(OldEmployer); raise; end; except ! RemoveFromEmployer(NewEmployer); raise; end; except ! Connector.RollbackTransaction; raise; end; ! finally ! Free; end; end; --- 461,502 ---- end; + procedure ReferenceEmployer(AEmployer: TCompany); + begin + _Employer.Reset; + if Assigned(AEmployer) then + _Employer.ReferenceObject(AEmployer.ClassType, AEmployer.Id); + end; + var OldEmployer: TCompany; begin OldEmployer := Employer; ! Connector.StartTransaction; try ! AddToEmployer(NewEmployer); try ! StoreEmployer(NewEmployer); ! RemoveFromEmployer(OldEmployer); try ! StoreEmployer(OldEmployer); ! ReferenceEmployer(NewEmployer); try ! Store; ! Connector.CommitTransaction; except ! ReferenceEmployer(OldEmployer); raise; end; except ! AddToEmployer(OldEmployer); raise; end; except ! RemoveFromEmployer(NewEmployer); raise; end; ! except ! Connector.RollbackTransaction; ! raise; end; end; *************** *** 569,572 **** --- 633,648 ---- end; + { TProject } + + function TProject.GetName: string; + begin + Result := _Name.Value; + end; + + procedure TProject.SetName(const Value: string); + begin + _Name.Value := Value; + end; + { TEmail } *************** *** 605,608 **** --- 681,689 ---- end; + function TContact.AddExternalPart(ExternalPart: TPartsExternal): Integer; + begin + Result := _ExternalParts.Add(ExternalPart); + end; + function TContact.AddPhone(Phone: TPhone): Integer; begin *************** *** 610,613 **** --- 691,699 ---- end; + function TContact.AddProject(Project: TProject): Integer; + begin + Result := _Projects.Add(Project); + end; + procedure TContact.AfterCreate; begin *************** *** 625,628 **** --- 711,719 ---- end; + procedure TContact.ClearExternalParts; + begin + _ExternalParts.Clear; + end; + procedure TContact.ClearPhones; begin *************** *** 630,633 **** --- 721,734 ---- end; + procedure TContact.ClearProjects; + begin + _Projects.Clear; + end; + + procedure TContact.DeleteExternalPart(Index: Integer); + begin + _ExternalParts.Delete(Index); + end; + procedure TContact.DeletePhone(Index: Integer); begin *************** *** 635,646 **** end; ! function TContact.GetAddress: TAddress; begin ! Result := _Address.Value as TAddress; end; ! function TContact.GetAddressExt: TAddress; begin ! Result := _AddressExt.Value as TAddress; end; --- 736,747 ---- end; ! procedure TContact.DeleteProject(Index: Integer); begin ! _Projects.Delete(Index); end; ! function TContact.GetAddress: TAddress; begin ! Result := _Address.Value as TAddress; end; *************** *** 660,663 **** --- 761,774 ---- end; + function TContact.GetExternalPartCount: Integer; + begin + Result := _ExternalParts.Count; + end; + + function TContact.GetExternalParts(Index: Integer): TPartsExternal; + begin + Result := _ExternalParts[Index] as TPartsExternal; + end; + function TContact.GetMainPhoneNumber: string; begin *************** *** 673,676 **** --- 784,792 ---- end; + function TContact.GetPartExternal: TPartExternal; + begin + Result := _PartExternal.Value as TPartExternal; + end; + function TContact.GetPhoneCount: Integer; begin *************** *** 683,686 **** --- 799,817 ---- end; + function TContact.GetProjectCount: Integer; + begin + Result := _Projects.Count; + end; + + function TContact.GetProjects(Index: Integer): TProject; + begin + Result := _Projects[Index] as TProject; + end; + + function TContact.IndexOfExternalPart(ExternalPart: TPartsExternal): Integer; + begin + Result := _ExternalParts.IndexOf(ExternalPart); + end; + function TContact.IndexOfPhone(Phone: TPhone): Integer; begin *************** *** 688,691 **** --- 819,832 ---- end; + function TContact.IndexOfProject(Project: TProject): Integer; + begin + Result := _Projects.IndexOf(Project); + end; + + procedure TContact.InsertExternalPart(Index: Integer; ExternalPart: TPartsExternal); + begin + _ExternalParts.Insert(Index, ExternalPart); + end; + procedure TContact.InsertPhone(Index: Integer; Phone: TPhone); begin *************** *** 693,696 **** --- 834,847 ---- end; + procedure TContact.InsertProject(Index: Integer; Project: TProject); + begin + _Projects.Insert(Index, Project); + end; + + function TContact.RemoveExternalPart(ExternalPart: TPartsExternal): Integer; + begin + Result := _ExternalParts.Remove(ExternalPart); + end; + function TContact.RemovePhone(Phone: TPhone): Integer; begin *************** *** 698,709 **** end; ! procedure TContact.SetAddress(Value: TAddress); begin ! _Address.Value := Value; end; ! procedure TContact.SetAddressExt(Value: TAddress); begin ! _AddressExt.Value := Value; end; --- 849,860 ---- end; ! function TContact.RemoveProject(Project: TProject): Integer; begin ! Result := _Projects.Remove(Project); end; ! procedure TContact.SetAddress(Value: TAddress); begin ! _Address.Value := Value; end; *************** *** 718,721 **** --- 869,877 ---- end; + procedure TContact.SetExternalParts(Index: Integer; Value: TPartsExternal); + begin + _ExternalParts[Index] := Value; + end; + procedure TContact.SetMainPhoneNumber(const Value: string); var *************** *** 740,743 **** --- 896,904 ---- end; + procedure TContact.SetPartExternal(Value: TPartExternal); + begin + _PartExternal.Value := Value; + end; + procedure TContact.SetPhones(Index: Integer; Value: TPhone); begin *************** *** 747,750 **** --- 908,916 ---- { TContactFilter } + procedure TContact.SetProjects(Index: Integer; Value: TProject); + begin + _Projects[Index] := Value; + end; + function TContactFilter.GetIsEmpty: Boolean; begin *************** *** 829,832 **** --- 995,1022 ---- end; + { TPartExternal } + + function TPartExternal.GetName: string; + begin + Result := _Name.Value; + end; + + procedure TPartExternal.SetName(const Value: string); + begin + _Name.Value := Value; + end; + + { TPartsExternal } + + function TPartsExternal.GetName: string; + begin + Result := _Name.Value; + end; + + procedure TPartsExternal.SetName(const Value: string); + begin + _Name.Value := Value; + end; + initialization InstantRegisterClasses([ *************** *** 838,843 **** TCountry, TEmail, TPerson, ! TPhone ]); --- 1028,1036 ---- TCountry, TEmail, + TPartExternal, + TPartsExternal, TPerson, ! TPhone, ! TProject ]); Index: TestIO.dpr =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.dpr,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TestIO.dpr 17 Oct 2005 10:05:08 -0000 1.14 --- TestIO.dpr 18 Oct 2005 03:10:19 -0000 1.15 *************** *** 1,5 **** program TestIO; ! {$I '../InstantDefines.inc'} {$IFDEF FPC} --- 1,5 ---- program TestIO; ! {$I '..\InstantDefines.inc'} {$IFDEF FPC} *************** *** 46,50 **** TestInstantPart in 'TestInstantPart.pas', TestInstantReference in 'TestInstantReference.pas', ! TestInstantObject in 'TestInstantObject.pas'; {$R *.res} --- 46,55 ---- TestInstantPart in 'TestInstantPart.pas', TestInstantReference in 'TestInstantReference.pas', ! TestInstantObject in 'TestInstantObject.pas', ! TestInstantObjectState in 'TestInstantObjectState.pas', ! TestInstantCache in 'TestInstantCache.pas', ! TestInstantObjectStore in 'TestInstantObjectStore.pas', ! TestInstantParts in 'TestInstantParts.pas', ! TestInstantReferences in 'TestInstantReferences.pas'; {$R *.res} *************** *** 54,57 **** --- 59,63 ---- Application.Initialize; InstantModel.ClassMetadatas.Clear; + // Application.CreateForm(TGUITestRunner, TestRunner); Application.CreateForm(TGUITestRunner, TestRunner); Application.Run; Index: TestInstantPart.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantPart.pas,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestInstantPart.pas 28 Jun 2005 03:45:50 -0000 1.5 --- TestInstantPart.pas 18 Oct 2005 03:10:19 -0000 1.6 *************** *** 87,102 **** vPart: TAddress; begin vAttrMetadata := TInstantAttributeMetadata.Create(nil); - vAttrMetadata.AttributeClass := TInstantPart; - vSource := TInstantPart.Create(FOwner, vAttrMetadata); try vPart := TAddress.Create(FConn); FInstantPart.Value := vPart; ! AssertTrue(FInstantPart.HasValue); ! AssertFalse(vSource.HasValue); vSource.Assign(FInstantPart); - AssertTrue(vSource.HasValue); - AssertNotSame(vPart, vSource.Value); finally vSource.Free; --- 87,105 ---- vPart: TAddress; begin + vSource := nil; + vAttrMetadata := TInstantAttributeMetadata.Create(nil); try + vAttrMetadata.AttributeClass := TInstantPart; + vSource := TInstantPart.Create(FOwner, vAttrMetadata); vPart := TAddress.Create(FConn); FInstantPart.Value := vPart; ! AssertTrue('Value HasVal', FInstantPart.HasValue); ! AssertEquals(1, FInstantPart.Value.RefCount); ! AssertEquals(1, vPart.RefCount); ! AssertFalse('vSource HasVal', vSource.HasValue); ! AssertNotSame(FInstantPart, vSource); vSource.Assign(FInstantPart); finally vSource.Free; Index: TestIO.cfg =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.cfg,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestIO.cfg 17 Oct 2005 10:05:08 -0000 1.6 --- TestIO.cfg 18 Oct 2005 03:10:19 -0000 1.7 *************** *** 13,17 **** -$M- -$N+ ! -$O+ -$P+ -$Q- --- 13,17 ---- -$M- -$N+ ! -$O- -$P+ -$Q- *************** *** 21,25 **** -$U- -$V+ ! -$W- -$X+ -$YD --- 21,25 ---- -$U- -$V+ ! -$W+ -$X+ -$YD *************** *** 34,41 **** -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"..\Core" ! -O"..\Core" ! -I"..\Core" ! -R"..\Core" -w-UNSAFE_TYPE -w-UNSAFE_CODE --- 34,41 ---- -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"D:\L\ubmock\src" ! -O"D:\L\ubmock\src" ! -I"D:\L\ubmock\src" ! -R"D:\L\ubmock\src" -w-UNSAFE_TYPE -w-UNSAFE_CODE Index: TestIO.mdr =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.mdr,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsU0tLHq and /tmp/cvsnDLOCq differ Index: TestInstantReference.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantReference.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestInstantReference.pas 28 Jun 2005 03:45:50 -0000 1.3 --- TestInstantReference.pas 18 Oct 2005 03:10:19 -0000 1.4 *************** *** 85,91 **** vSource: TInstantReference; vAttrMetadata: TInstantAttributeMetadata; ! vPart: TCategory; begin ! vPart := nil; vAttrMetadata := TInstantAttributeMetadata.Create(nil); --- 85,91 ---- vSource: TInstantReference; vAttrMetadata: TInstantAttributeMetadata; ! vCategory: TCategory; begin ! vCategory := nil; vAttrMetadata := TInstantAttributeMetadata.Create(nil); *************** *** 93,106 **** vSource := TInstantReference.Create(FOwner, vAttrMetadata); try ! vPart := TCategory.Create(FConn); ! FInstantReference.Value := vPart; AssertTrue('Value HasVal', FInstantReference.HasValue); AssertFalse('vSource HasVal', vSource.HasValue); vSource.Assign(FInstantReference); AssertTrue('Assign HasVal', vSource.HasValue); AssertNotSame(vSource, FInstantReference.Value); finally ! vPart.Free; vSource.Free; vAttrMetadata.Free; --- 93,108 ---- vSource := TInstantReference.Create(FOwner, vAttrMetadata); try ! vCategory := TCategory.Create(FConn); ! FInstantReference.Value := vCategory; AssertTrue('Value HasVal', FInstantReference.HasValue); + AssertTrue('Value HasReference', FInstantReference.HasReference); AssertFalse('vSource HasVal', vSource.HasValue); vSource.Assign(FInstantReference); AssertTrue('Assign HasVal', vSource.HasValue); + AssertTrue('Assign HasReference', vSource.HasReference); AssertNotSame(vSource, FInstantReference.Value); finally ! vCategory.Free; vSource.Free; vAttrMetadata.Free; *************** *** 145,148 **** --- 147,151 ---- AssertTrue('AttachObject HasRef', FInstantReference.HasReference); AssertEquals('Object RefCount 2', 2, vObject.RefCount); + vObject.Store; vStream := TInstantStream.Create; *************** *** 157,162 **** vStream.Position := 0; FInstantReference.LoadObjectFromStream(vStream); - AssertTrue('LoadObjectFromStream HasVal', FInstantReference.HasValue); AssertTrue('LoadObjectFromStream HasRef', FInstantReference.HasReference); AssertEquals('Object RefCount 4', 1, vObject.RefCount); finally --- 160,168 ---- vStream.Position := 0; FInstantReference.LoadObjectFromStream(vStream); AssertTrue('LoadObjectFromStream HasRef', FInstantReference.HasReference); + AssertTrue('LoadObjectFromStream HasVal', FInstantReference.HasValue); + AssertEquals('LoadObjectFromStream RefCount', 1, + FInstantReference.Value.RefCount); + AssertNotSame('Same Object??', vObject, FInstantReference.Value); AssertEquals('Object RefCount 4', 1, vObject.RefCount); finally Index: MinimalModel.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/MinimalModel.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MinimalModel.pas 8 Sep 2005 07:35:32 -0000 1.4 --- MinimalModel.pas 18 Oct 2005 03:10:19 -0000 1.5 *************** *** 25,29 **** * * Contributor(s): ! * * * ***** END LICENSE BLOCK ***** *) --- 25,29 ---- * * Contributor(s): ! * Steven Mitchell * * ***** END LICENSE BLOCK ***** *) Index: TestInstantTableMetadata.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantTableMetadata.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestInstantTableMetadata.pas 28 Jun 2005 03:45:50 -0000 1.6 --- TestInstantTableMetadata.pas 18 Oct 2005 03:10:19 -0000 1.7 *************** *** 76,80 **** FOwner := TInstantScheme.Create; FOwner.Catalog := TInstantModelCatalog.Create(FOwner, InstantModel); ! FInstantTableMetadata := FOwner.FindTableMetadata('Address'); end; --- 76,80 ---- FOwner := TInstantScheme.Create; FOwner.Catalog := TInstantModelCatalog.Create(FOwner, InstantModel); ! FInstantTableMetadata := FOwner.FindTableMetadata('Country'); end; Index: TestIO.mdx =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestIO.mdx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestIO.mdx 24 Jul 2005 16:34:58 -0000 1.2 --- TestIO.mdx 18 Oct 2005 03:10:19 -0000 1.3 *************** *** 1 **** ! <TInstantClassMetadatas><TInstantClassMetadata><Name>TAddress</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>City</Name><AttributeType>atString</AttributeType><IsIndexed>TRUE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Country</Name><AttributeType>atReference</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TCountry</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>State</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>4</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Street</Name><AttributeType>atMemo</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Zip</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>10</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TCountry</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TPhone</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>20</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Number</Name><AttributeType>atString</AttributeType><EditMask>(000) 000-0000;0;_</EditMask><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>20</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TEmail</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Address</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>100</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TCategory</Name><Persistence>peStored</Persistence><StorageName>Categories</StorageName><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TContact</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Address</Name><AttributeType>atPart</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TAddress</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Category</Name><AttributeType>atReference</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TCategory</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>City</Name><AttributeType>atString</AttributeType><IsIndexed>TRUE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>TRUE</IsIndexed><IsRequired>FALSE</IsRequired><Size>50</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Phones</Name><AttributeType>atParts</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TPhone</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>AddressExt</Name><AttributeType>atPart</AttributeType><StorageKind>skExternal</StorageKind><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TAddress</ObjectClassName></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TContactFilter</Name><ParentName>TContact</ParentName><Persistence>peEmbedded</Persistence><AttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TPerson</Name><ParentName>TContact</ParentName><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>BirthDate</Name><AttributeType>atDateTime</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Emails</Name><AttributeType>atParts</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TEmail</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Employer</Name><AttributeType>atReference</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TCompany</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Picture</Name><AttributeType>atBlob</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Salary</Name><AttributeType>atCurrency</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Employed</Name><AttributeType>atBoolean</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>AL_hours</Name><AttributeType>atFloat</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TCompany</Name><ParentName>TContact</ParentName><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Employees</Name><AttributeType>atReferences</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TPerson</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>NoOfBranches</Name><AttributeType>atInteger</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata></TInstantClassMetadatas> \ No newline at end of file --- 1 ---- ! <TInstantClassMetadatas><TInstantClassMetadata><Name>TAddress</Name><Persistence>peEmbedded</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>City</Name><AttributeType>atString</AttributeType><IsIndexed>TRUE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Country</Name><AttributeType>atReference</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TCountry</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>State</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>4</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Street</Name><AttributeType>atMemo</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Zip</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>10</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TCountry</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TPhone</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>20</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Number</Name><AttributeType>atString</AttributeType><EditMask>(000) 000-0000;0;_</EditMask><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>20</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TEmail</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Address</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>100</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TCategory</Name><Persistence>peStored</Persistence><StorageName>Categories</StorageName><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TContact</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Address</Name><AttributeType>atPart</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TAddress</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Category</Name><AttributeType>atReference</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TCategory</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>City</Name><AttributeType>atString</AttributeType><IsIndexed>TRUE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>TRUE</IsIndexed><IsRequired>FALSE</IsRequired><Size>50</Size></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Phones</Name><AttributeType>atParts</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TPhone</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Projects</Name><AttributeType>atReferences</AttributeType><ExternalStorageName>Contact_Projects</ExternalStorageName><StorageKind>skExternal</StorageKind><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TProject</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>PartExternal</Name><AttributeType>atPart</AttributeType><StorageKind>skExternal</StorageKind><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TPartExternal</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>ExternalParts</Name><AttributeType>atParts</AttributeType><ExternalStorageName>Contact_ExternalParts</ExternalStorageName><StorageKind>skExternal</StorageKind><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TPartsExternal</ObjectClassName></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TContactFilter</Name><ParentName>TContact</ParentName><Persistence>peEmbedded</Persistence><AttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TPerson</Name><ParentName>TContact</ParentName><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>BirthDate</Name><AttributeType>atDateTime</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Emails</Name><AttributeType>atParts</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TEmail</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Employer</Name><AttributeType>atReference</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TCompany</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Picture</Name><AttributeType>atBlob</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Salary</Name><AttributeType>atCurrency</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>Employed</Name><AttributeType>atBoolean</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>AL_hours</Name><AttributeType>atFloat</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TCompany</Name><ParentName>TContact</ParentName><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Employees</Name><AttributeType>atReferences</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><ObjectClassName>TPerson</ObjectClassName></TInstantAttributeMetadata><TInstantAttributeMetadata><Name>NoOfBranches</Name><AttributeType>atInteger</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TProject</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TPartExternal</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired><Size>30</Size></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata><TInstantClassMetadata><Name>TPartsExternal</Name><Persistence>peStored</Persistence><AttributeMetadatas><TInstantAttributeMetadatas><TInstantAttributeMetadata><Name>Name</Name><AttributeType>atString</AttributeType><IsIndexed>FALSE</IsIndexed><IsRequired>FALSE</IsRequired></TInstantAttributeMetadata></TInstantAttributeMetadatas></AttributeMetadatas></TInstantClassMetadata></TInstantClassMetadatas> \ No newline at end of file Index: TestInstantElement.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Tests/TestInstantElement.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestInstantElement.pas 28 Jun 2005 03:45:51 -0000 1.6 --- TestInstantElement.pas 18 Oct 2005 03:10:19 -0000 1.7 *************** *** 137,142 **** {$IFNDEF CURR_TESTS} RegisterTests([TestTInstantElement]); - {$ELSE} - RegisterTests([TestTInstantElement]); {$ENDIF} --- 137,140 ---- |
From: Steven M. <sr...@us...> - 2005-10-18 03:08:39
|
Update of /cvsroot/instantobjects/Source/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11851 Modified Files: InstantPersistence.pas InstantCode.pas InstantClasses.pas Log Message: Added some updates (fixes) from Riceball Lee and some others found from development of unit tests. Index: InstantCode.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantCode.pas,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** InstantCode.pas 17 Oct 2005 19:36:05 -0000 1.19 --- InstantCode.pas 18 Oct 2005 03:08:31 -0000 1.20 *************** *** 26,30 **** * Contributor(s): * Carlo Barazzetta, Adrea Petrelli, Nando Dessena, Steven Mitchell, ! * Uberto Barbini, Joao Morais * * ***** END LICENSE BLOCK ***** *) --- 26,30 ---- * Contributor(s): * Carlo Barazzetta, Adrea Petrelli, Nando Dessena, Steven Mitchell, ! * Uberto Barbini, Joao Morais, Riceball Lee * * ***** END LICENSE BLOCK ***** *) *************** *** 3864,3867 **** --- 3864,3872 ---- function TInstantCodeAttribute.GetSingularName: string; + const + Vowels = ['a', 'e', 'i', 'o', 'u']; + SpChars = ['s', 'x', 'h']; + var + i: integer; begin if FSingularName <> '' then *************** *** 3869,3874 **** else begin Result := Name; ! if Copy(Result, Length(Result), 1) = 's' then ! Result := Copy(Result, 1, Length(Result) - 1); end; end; --- 3874,3900 ---- else begin Result := Name; ! //added the Vowels changes. ! i := Length(Result); ! if Copy(Result, i, 1) = 's' then ! begin ! If (i > 3) and (Copy(Result, i - 2, 3) = 'ies') and ! not (Result[i - 3] in Vowels) then ! begin ! Result := Copy(Result, 1, i - 3) + 'y'; ! end ! else If (i > 3) and (Copy(Result, i - 1, 2) = 'es') and ! (Result[i - 2] in SpChars) then ! begin ! if (Result[i - 2] = 'h') and not (Result[i - 3] in ['c', 's']) then ! begin ! //not ch or sh ! Result := Copy(Result, 1, i - 1); ! end ! else ! Result := Copy(Result, 1, i - 2); ! end ! else ! Result := Copy(Result, 1, i - 1); ! end end; end; Index: InstantPersistence.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantPersistence.pas,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** InstantPersistence.pas 16 Oct 2005 23:10:20 -0000 1.59 --- InstantPersistence.pas 18 Oct 2005 03:08:31 -0000 1.60 *************** *** 26,30 **** * Contributor(s): * Carlo Barazzetta, Andrea Petrelli, Nando Dessena, Steven Mitchell, ! * Joao Morais, Cesar Coll, Uberto Barbini, David Taylor, Hanedi Salas * * ***** END LICENSE BLOCK ***** *) --- 26,31 ---- * Contributor(s): * Carlo Barazzetta, Andrea Petrelli, Nando Dessena, Steven Mitchell, ! * Joao Morais, Cesar Coll, Uberto Barbini, David Taylor, Hanedi Salas, ! * Riceball Lee * * ***** END LICENSE BLOCK ***** *) *************** *** 6739,6743 **** procedure TInstantParts.DestroyObject(Index: Integer); begin ! ObjectReferences[Index].DestroyInstance; end; --- 6740,6745 ---- procedure TInstantParts.DestroyObject(Index: Integer); begin ! if Metadata.StorageKind <> skEmbedded then ! ObjectReferences[Index].DestroyInstance; end; *************** *** 6811,6814 **** --- 6813,6817 ---- try Result := ObjectReferenceList.Add(Ref); + AObject.Free; SetOwnerContext(AObject); except *************** *** 6932,6935 **** --- 6935,6940 ---- try ObjectReferenceList.Insert(Index, Ref); + AObject.Free; + SetOwnerContext(AObject); except Ref.Free; *************** *** 8604,8613 **** procedure TInstantObject.RestoreState; begin if (FSaveStateLevel = 1) and not IsAbandoned then try ! ObjectStore.RemoveFromCache(Self); State.Assign(SavedState); ! if IsPersistent then ObjectStore.AddToCache(Self); except --- 8609,8624 ---- procedure TInstantObject.RestoreState; + var + vInCache: Boolean; begin if (FSaveStateLevel = 1) and not IsAbandoned then try ! vInCache := ObjectStore.Find(Self.PersistentId) = Self; ! if vInCache then ! begin ! ObjectStore.RemoveFromCache(Self); ! end; State.Assign(SavedState); ! if vInCache and IsPersistent then ObjectStore.AddToCache(Self); except *************** *** 10129,10134 **** function TInstantBroker.IsCatalogSupported: Boolean; begin ! Result := CreateCatalog(nil) <> nil; end; --- 10140,10160 ---- function TInstantBroker.IsCatalogSupported: Boolean; + var + vCatalog: TInstantCatalog; begin ! // Result := CreateCatalog(nil) <> nil; ! vCatalog := nil; ! ! try ! try ! vCatalog := CreateCatalog(nil); ! Result := Assigned(vCatalog); ! except ! Result := False; ! raise; ! end; ! finally ! vCatalog.Free; ! end; end; *************** *** 10174,10179 **** begin Result := FConnector; ! if not Assigned(Result) then ! raise EInstantError.Create(SUnassignedConnector); end; --- 10200,10204 ---- begin Result := FConnector; ! InstantCheckConnector(Result); end; *************** *** 12581,12585 **** else begin DataSet.First; ! while Value > 1 do begin DataSet.Next; --- 12606,12610 ---- else begin DataSet.First; ! while (not Dataset.Eof) and (Value > 1) do begin DataSet.Next; *************** *** 13480,13484 **** try Result := Broker.Execute(AStatement, AParams); ! Info.Success := Result = 1; Info.Conflict := not Info.Success or (ConflictAction = caIgnore); except --- 13505,13509 ---- try Result := Broker.Execute(AStatement, AParams); ! Info.Success := Result >= 1; Info.Conflict := not Info.Success or (ConflictAction = caIgnore); except *************** *** 13831,13835 **** begin Statement := UpdateSQL; ! ExecuteStatement(Statement, Params, Info, ConflictAction, AObject) end; if not Info.Success then --- 13856,13860 ---- begin Statement := UpdateSQL; ! ExecuteStatement(Statement, Params, Info, ConflictAction, AObject); end; if not Info.Success then *************** *** 13895,13899 **** PartObject.CheckId; PartObject.ObjectStore.StoreObject(PartObject, caIgnore); - end; end; --- 13920,13923 ---- Index: InstantClasses.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantClasses.pas,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** InstantClasses.pas 4 Sep 2005 23:15:54 -0000 1.9 --- InstantClasses.pas 18 Oct 2005 03:08:31 -0000 1.10 *************** *** 25,29 **** * * Contributor(s): ! * Carlo Barazzetta, Adrea Petrelli, Marco Cantù, Nando Dessena, Uberto Barbini * * ***** END LICENSE BLOCK ***** *) --- 25,30 ---- * * Contributor(s): ! * Carlo Barazzetta, Adrea Petrelli, Marco Cantù, Nando Dessena, Uberto Barbini, ! * Riceball Lee * * ***** END LICENSE BLOCK ***** *) *************** *** 1669,1682 **** begin PushObjectClass(FindClass(Reader.ReadStr)); ! Producer.WriteStartTag(ObjectClassName); ! if ObjectClass.InheritsFrom(TInstantStreamable) then ! TInstantStreamableClass(ObjectClass).ConvertToText(Self) ! else if ObjectClass.InheritsFrom(TInstantCollection) then ! TInstantCollectionClass(ObjectClass).ConvertToText(Self) ! else if ObjectClass.InheritsFrom(TInstantCollectionItem) then ! TInstantCollectionItemClass(ObjectClass).ConvertToText(Self); ! Reader.ReadListEnd; ! Producer.WriteEndTag; ! PopObjectClass; end; --- 1670,1686 ---- begin PushObjectClass(FindClass(Reader.ReadStr)); ! try ! Producer.WriteStartTag(ObjectClassName); ! if ObjectClass.InheritsFrom(TInstantStreamable) then ! TInstantStreamableClass(ObjectClass).ConvertToText(Self) ! else if ObjectClass.InheritsFrom(TInstantCollection) then ! TInstantCollectionClass(ObjectClass).ConvertToText(Self) ! else if ObjectClass.InheritsFrom(TInstantCollectionItem) then ! TInstantCollectionItemClass(ObjectClass).ConvertToText(Self); ! Reader.ReadListEnd; ! Producer.WriteEndTag; ! finally ! PopObjectClass; ! end; end; *************** *** 1872,1885 **** begin PushObjectClass(FindClass(Processor.ReadTagName)); ! Writer.WriteStr(ObjectClassName); ! if ObjectClass.InheritsFrom(TInstantStreamable) then ! TInstantStreamableClass(ObjectClass).ConvertToBinary(Self) ! else if ObjectClass.InheritsFrom(TInstantCollection) then ! TInstantCollectionClass(ObjectClass).ConvertToBinary(Self) ! else if ObjectClass.InheritsFrom(TInstantCollectionItem) then ! TInstantCollectionItemClass(ObjectClass).ConvertToBinary(Self); ! Processor.ReadTag; ! Writer.WriteListEnd; ! PopObjectClass; end; --- 1876,1892 ---- begin PushObjectClass(FindClass(Processor.ReadTagName)); ! try ! Writer.WriteStr(ObjectClassName); ! if ObjectClass.InheritsFrom(TInstantStreamable) then ! TInstantStreamableClass(ObjectClass).ConvertToBinary(Self) ! else if ObjectClass.InheritsFrom(TInstantCollection) then ! TInstantCollectionClass(ObjectClass).ConvertToBinary(Self) ! else if ObjectClass.InheritsFrom(TInstantCollectionItem) then ! TInstantCollectionItemClass(ObjectClass).ConvertToBinary(Self); ! Processor.ReadTag; ! Writer.WriteListEnd; ! finally ! PopObjectClass; ! end; end; |
From: Steven M. <sr...@us...> - 2005-10-18 03:02:53
|
Update of /cvsroot/instantobjects/Source/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9666 Modified Files: InstantAccessors.pas Log Message: In InstantObjectAccessor destroy, force release of referenced objects to help avoid ownership contention with circular references. Index: InstantAccessors.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantAccessors.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InstantAccessors.pas 4 Sep 2005 23:15:54 -0000 1.3 --- InstantAccessors.pas 18 Oct 2005 03:02:42 -0000 1.4 *************** *** 25,29 **** * * Contributor(s): ! * Nando Dessena * * ***** END LICENSE BLOCK ***** *) --- 25,29 ---- * * Contributor(s): ! * Nando Dessena, Steven Mitchell * * ***** END LICENSE BLOCK ***** *) *************** *** 116,120 **** --- 116,128 ---- destructor TInstantObjectAccessor.Destroy; + var + i: Integer; begin + // Force release of referenced objects to help avoid + // ownership contention with circular references. + if InContent and (Container is TInstantReferences) then + for i := 0 to Pred(Container.Count) do + TInstantReferences(Container).DestroyObject(i); + if Assigned(Subject) then Subject.Free; |
From: Carlo B. <car...@us...> - 2005-10-17 19:43:17
|
Update of /cvsroot/instantobjects/Demos/PrimerCross In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6254/Demos/PrimerCross Modified Files: Primer.cfg Primer.dof Primer.res PrimerExternal.cfg PrimerExternal.dof PrimerExternal.res Log Message: Updated Primer and PrimerExternal demos to version 2.0 and added a program icon of IO logo Index: Primer.dof =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/Primer.dof,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Primer.dof 10 Feb 2005 13:04:33 -0000 1.5 --- Primer.dof 17 Oct 2005 19:43:08 -0000 1.6 *************** *** 95,99 **** PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=$(DELPHI)\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB Packages= Conditionals= --- 95,99 ---- PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=$(DELPHI)\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML Packages= Conditionals= *************** *** 113,118 **** IncludeVerInfo=1 AutoIncBuild=0 ! MajorVer=1 ! MinorVer=7 Release=0 Build=0 --- 113,118 ---- IncludeVerInfo=1 AutoIncBuild=0 ! MajorVer=2 ! MinorVer=0 Release=0 Build=0 *************** *** 127,131 **** CompanyName=InstantObjects.org FileDescription=Primer Demo ! FileVersion=1.7.0.0 InternalName= LegalCopyright=MPL public license --- 127,131 ---- CompanyName=InstantObjects.org FileDescription=Primer Demo ! FileVersion=2.0.0.0 InternalName= LegalCopyright=MPL public license *************** *** 133,136 **** OriginalFilename= ProductName= ! ProductVersion=1.7 Comments= --- 133,136 ---- OriginalFilename= ProductName= ! ProductVersion=2.0 Comments= Index: Primer.res =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/Primer.res,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsKkaHub and /tmp/cvsUW0bDp differ Index: Primer.cfg =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/Primer.cfg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Primer.cfg 10 Feb 2005 13:04:33 -0000 1.4 --- Primer.cfg 17 Oct 2005 19:43:08 -0000 1.5 *************** *** 34,41 **** -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" ! -O"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" ! -I"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" ! -R"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" -w-UNIT_PLATFORM -w-UNSAFE_TYPE --- 34,41 ---- -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" ! -O"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" ! -I"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" ! -R"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" -w-UNIT_PLATFORM -w-UNSAFE_TYPE Index: PrimerExternal.res =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/PrimerExternal.res,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsMZNt3b and /tmp/cvsb7Zrjq differ Index: PrimerExternal.cfg =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/PrimerExternal.cfg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PrimerExternal.cfg 7 Dec 2004 08:45:33 -0000 1.2 --- PrimerExternal.cfg 17 Oct 2005 19:43:08 -0000 1.3 *************** *** 34,41 **** -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" ! -O"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" ! -I"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" ! -R"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB" -w-UNIT_PLATFORM -w-UNSAFE_TYPE --- 34,41 ---- -LE"c:\programmi\borland\delphi7\Projects\Bpl" -LN"c:\programmi\borland\delphi7\Projects\Bpl" ! -U"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" ! -O"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" ! -I"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" ! -R"c:\programmi\borland\delphi7\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML" -w-UNIT_PLATFORM -w-UNSAFE_TYPE Index: PrimerExternal.dof =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/PrimerExternal.dof,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PrimerExternal.dof 10 Feb 2005 13:04:33 -0000 1.1 --- PrimerExternal.dof 17 Oct 2005 19:43:08 -0000 1.2 *************** *** 95,99 **** PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=$(DELPHI)\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB Packages= Conditionals= --- 95,99 ---- PackageDLLOutputDir= PackageDCPOutputDir= ! SearchPath=$(DELPHI)\Lib\Debug;..\..\Source\Core;..\..\Source\Brokers\DBX;..\..\Source\Brokers\ADO;..\..\Source\Brokers\BDE;..\..\Source\Brokers\IBX;..\..\Source\Brokers\XML;..\..\Source\Brokers\UIB;..\..\Source\Brokers\ZeosDBO;..\..\Source\Catalogs\BDE;..\..\Source\Catalogs\MsSql;..\..\Source\Catalogs\IbFb;..\..\Source\Catalogs\XML Packages= Conditionals= *************** *** 113,119 **** IncludeVerInfo=1 AutoIncBuild=0 ! MajorVer=1 ! MinorVer=6 ! Release=7 Build=0 Debug=0 --- 113,119 ---- IncludeVerInfo=1 AutoIncBuild=0 ! MajorVer=2 ! MinorVer=0 ! Release=0 Build=0 Debug=0 *************** *** 127,131 **** CompanyName=InstantObjects.org FileDescription=Primer Demo ! FileVersion=1.6.7.0 InternalName= LegalCopyright=MPL public license --- 127,131 ---- CompanyName=InstantObjects.org FileDescription=Primer Demo ! FileVersion=2.0.0.0 InternalName= LegalCopyright=MPL public license *************** *** 133,137 **** OriginalFilename= ProductName= ! ProductVersion=1.6.7 Comments= [Excluded Packages] --- 133,137 ---- OriginalFilename= ProductName= ! ProductVersion=2.0 Comments= [Excluded Packages] |
From: Carlo B. <car...@us...> - 2005-10-17 19:43:16
|
Update of /cvsroot/instantobjects/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6254/Help Added Files: IO_icon_32x32.ico Log Message: Updated Primer and PrimerExternal demos to version 2.0 and added a program icon of IO logo --- NEW FILE: IO_icon_32x32.ico --- (This appears to be a binary file; contents omitted.) |
From: Carlo B. <car...@us...> - 2005-10-17 19:42:16
|
Update of /cvsroot/instantobjects/Source/Brokers/DBX/D2005 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6025/Source/Brokers/DBX/D2005 Added Files: DclIODBX.dpk IODBX.dpk Log Message: Added D2005 support for IBX, ZeosDBO, MsSqlCatalog --- NEW FILE: DclIODBX.dpk --- package DclIODBX; {$I '..\..\..\InstantVersion.inc'} {$R '..\InstantDBX.dcr'} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS ON} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects dbExpress Design-Time Support (Delphi 2005)'} {$LIBSUFFIX '_D9'} {$DESIGNONLY} {$IMPLICITBUILD OFF} requires rtl, vcl, dbrtl, dbexpress, IOCore, IODBX; contains InstantDBXReg in '..\InstantDBXReg.pas'; end. --- NEW FILE: IODBX.dpk --- package IODBX; {$R *.res} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects dbExpress Run-Time Support (Delphi 2005)'} {$LIBSUFFIX '_D9'} {$RUNONLY} {$IMPLICITBUILD OFF} requires rtl, vcl, dbrtl, dbexpress, IOCore, IOIBFbCatalog, IOMSSqlCatalog; contains InstantDBXConnectionDefEdit in '..\InstantDBXConnectionDefEdit.pas' {InstantDBXConnectionDefEditForm}, InstantDBX in '..\InstantDBX.pas'; end. |
From: Carlo B. <car...@us...> - 2005-10-17 19:42:13
|
Update of /cvsroot/instantobjects/Source/Catalogs/MSSql/D2005 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6025/Source/Catalogs/MSSql/D2005 Added Files: IOMSSqlCatalog.dpk Log Message: Added D2005 support for IBX, ZeosDBO, MsSqlCatalog --- NEW FILE: IOMSSqlCatalog.dpk --- package IOMSSqlCatalog; {$I '..\..\..\InstantVersion.inc'} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS ON} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects Catalog for MS-Sql (Delphi 2005)'} {$LIBSUFFIX '_D9'} {$RUNONLY} {$IMPLICITBUILD OFF} requires rtl, IOCore; contains InstantMSSqlCatalog in '..\InstantMSSqlCatalog.pas'; end. |
From: Carlo B. <car...@us...> - 2005-10-17 19:42:13
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D2005 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6025/Source/Brokers/ZeosDBO/D2005 Added Files: DclIOZeosDBO.dpk IOZeosDBO.dpk Log Message: Added D2005 support for IBX, ZeosDBO, MsSqlCatalog --- NEW FILE: DclIOZeosDBO.dpk --- package DclIOZeosDBO; {$I '..\..\..\InstantVersion.inc'} {$R '..\InstantZeosDBO.dcr'} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS ON} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects ZeosDBO Design-Time Support (Delphi 2005)'} {$LIBSUFFIX '_D9'} {$DESIGNONLY} {$IMPLICITBUILD OFF} requires IOZeosDBO; contains InstantZeosDBOReg in '..\InstantZeosDBOReg.pas'; end. --- NEW FILE: IOZeosDBO.dpk --- package IOZeosDBO; {$I '..\..\..\InstantVersion.inc'} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS ON} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DESCRIPTION 'InstantObjects ZeosDBO Run-Time Support (Delphi 2005)'} {$LIBSUFFIX '_D9'} {$RUNONLY} {$IMPLICITBUILD OFF} requires IOCore, ZComponent, IOIbFbCatalog, IOMSSqlCatalog; contains InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}, InstantZeosDBO in '..\InstantZeosDBO.pas'; end. |
From: Carlo B. <car...@us...> - 2005-10-17 19:40:22
|
Update of /cvsroot/instantobjects/Source/Catalogs/MSSql/D2005 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5712/D2005 Log Message: Directory /cvsroot/instantobjects/Source/Catalogs/MSSql/D2005 added to the repository |
From: Carlo B. <car...@us...> - 2005-10-17 19:39:48
|
Update of /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D2005 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5580/D2005 Log Message: Directory /cvsroot/instantobjects/Source/Brokers/ZeosDBO/D2005 added to the repository |