diff --git a/Source/BoldAbstractPartiallyExternalPC.pas b/Source/BoldAbstractPartiallyExternalPC.pas index 43afc0e..53b276e 100644 --- a/Source/BoldAbstractPartiallyExternalPC.pas +++ b/Source/BoldAbstractPartiallyExternalPC.pas @@ -191,7 +191,7 @@ function TBoldAbstractPartiallyExternalPC.ExternalKeysToInternalSQL( raise EBold.CreateFmt(sNotSupportedWithNoKeys, [classname, MoldClass.ExpandedExpressionName]); result := format('%s.%s in (', [ - BoldExpandName(ExternalKey.MoldClass.Tablename, ExternalKey.MoldClass.Name, xtSQL, -1, nccFalse), + BoldExpandName(ExternalKey.MoldClass.ExternalTableName, ExternalKey.MoldClass.Name, xtSQL, -1, nccFalse), BoldExpandName(ExternalKey.ColumnName, ExternalKey.name, xtSQL, -1, nccFalse)]); Mapping := TypeNameDictionary.MappingForModelName[ExternalKey.BoldType]; KeyIsString := assigned(Mapping) and SameText(Mapping.ExpandedContentsName, BoldContentName_String); diff --git a/Source/BoldDefaultTaggedValues.pas b/Source/BoldDefaultTaggedValues.pas index 44bddfb..f9aff53 100644 --- a/Source/BoldDefaultTaggedValues.pas +++ b/Source/BoldDefaultTaggedValues.pas @@ -123,6 +123,7 @@ interface TAG_ROOTCLASS: String = 'RootClass'; TAG_TABLENAME: String = 'TableName'; + TAG_EXTERNALTABLENAME: String = 'ExternalTableName'; TAG_TYPELIBVERSION = 'TypeLibVersion'; TAG_UNITNAME: String = 'UnitName'; @@ -214,6 +215,7 @@ procedure AddDefaultTaggedValues; Add('String', TAG_CPPNAME, TV_NAME); Add('String', TAG_EXPRESSIONNAME, TV_NAME); Add('String', TAG_TABLENAME, TV_NAME); + Add('String', TAG_EXTERNALTABLENAME, TV_NAME); Add('EvolutionStateEnum', TAG_EVOLUTIONSTATE, TV_EVOLUTIONSTATE_NORMAL); Add('String', TAG_PMAPPERNAME, DEFAULTNAMELITERAL); diff --git a/Source/BoldExternalPersistenceControllerSQL.pas b/Source/BoldExternalPersistenceControllerSQL.pas index ccffd1b..69a24a9 100644 --- a/Source/BoldExternalPersistenceControllerSQL.pas +++ b/Source/BoldExternalPersistenceControllerSQL.pas @@ -208,7 +208,7 @@ implementation function _GetTableName(MoldClass: TMoldClass): String; begin - Result := BoldExpandName(MoldClass.TableName, MoldClass.name, xtSQL, -1, nccFalse); + Result := BoldExpandName(MoldClass.ExternalTableName, MoldClass.name, xtSQL, -1, nccFalse); end; function _GetColumnName(BoldMember: TMoldMember): String; diff --git a/Source/BoldMeta.pas b/Source/BoldMeta.pas index 5dccd79..07e3671 100644 --- a/Source/BoldMeta.pas +++ b/Source/BoldMeta.pas @@ -410,6 +410,7 @@ TMoldClass = class(TMoldElement) function GetBoldUnitName: string; function GetImported: Boolean; function GetTableName: string; + function GetExternalTableName: string; procedure SetBoldUnitName(const Value: string); procedure SetIncFileName(const Value: string); function GetDefaultStringRepresentation: String; @@ -450,6 +451,7 @@ TMoldClass = class(TMoldElement) function EffectiveIncFileName(const DefaultExtension: String): String; property TableMapping: TTableMapping read GetTablemapping; property TableName: string read GetTableName; + property ExternalTableName: string read GetExternalTableName; property IsRootClass: Boolean read GetIsRootClass; property SuperClass: TMoldClass read FSuperClass write SetSuperClass; property SubClasses: TMoldClassList read FSubClasses; @@ -2009,6 +2011,11 @@ function TMoldClass.GetTableName: string; result := BoldTVByName[TAG_TABLENAME]; end; +function TMoldClass.GetExternalTableName: string; +begin + result := BoldTVByName[TAG_EXTERNALTABLENAME]; +end; + procedure TMoldClass.SetBoldUnitName(const Value: string); begin BoldTVByName[TAG_UNITNAME] := Value;