- Home
- LLBLGen Pro
- LLBLGen Pro Runtime Framework
Exception when trying first generation with V3
Hi there,
I've converted a V2.6 project and I'm getting the following error upon F7...
Internal Error Exception occured in: SD.LLBLGen.Pro.ApplicationCore.MetaData.DatabaseMetaData.CreateFkConstraint: No fieldPairs specified
-----[Core exception]-------------------- at SD.LLBLGen.Pro.ApplicationCore.MetaData.DatabaseMetaData.CreateFkConstraint(List
1 fieldPairs, MultiValueDictionary
2 modelBasedForeignKeyConstraints) at SD.LLBLGen.Pro.ApplicationCore.MetaData.MetaDataStore.CreateFkConstraintForDatabase(String driverID, List1 fieldPairs, MultiValueDictionary
2 modelBasedForeignKeyConstraints) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.ProduceFkConstraintsForInheritanceEdge(InheritanceEdge edge, MultiValueDictionary2 modelBasedForeignKeyConstraints) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.ProduceFkConstraintsForInheritanceEdges(MultiValueDictionary
2 modelBasedForeignKeyConstraints) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.RunValidationAndMetaDataAdjustProcess(Boolean validationOnly) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.ValidateAndOptionallyAdjustMetaData(Boolean validationOnly) at SD.LLBLGen.Pro.Gui.Classes.GuiController.<>c__DisplayClassd8.<PerformProjectValidationAndOptionallyMetaDataAdjustmentAction>b__d3() at SD.Tools.Algorithmia.Commands.Command`1.Do() in C:\Myprojects\VS.NET Projects\Algorithmia\SD.Tools.Algorithmia\Commands\Command.cs:line 178 at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) in C:\Myprojects\VS.NET Projects\Algorithmia\SD.Tools.Algorithmia\Commands\CommandQueue.cs:line 151 at SD.Tools.Algorithmia.Commands.CommandQueue.DoCurrentCommand() in C:\Myprojects\VS.NET Projects\Algorithmia\SD.Tools.Algorithmia\Commands\CommandQueue.cs:line 127 at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) in C:\Myprojects\VS.NET Projects\Algorithmia\SD.Tools.Algorithmia\Commands\CommandQueueManager.cs:line 381 at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformProjectValidationAndOptionallyMetaDataAdjustmentAction(Boolean validationOnly, Boolean showMessageBoxOnZeroErrors) at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformGenerateSourceCodeAction() at SD.LLBLGen.Pro.Gui.Forms.MainWindow.HandleMainMenuCommand(CommandEventArgs e) at SD.LLBLGen.Pro.Gui.Forms.MainWindow._mainMenu_CommandClick(Object sender, CommandEventArgs e) at Janus.Windows.UI.CommandBars.UICommandManager.OnCommandClick(CommandEventArgs e) at Janus.Windows.UI.CommandBars.UICommandManager.Janus.Windows.UI.CommandBars.ICommandOwner.OnCommandClicked(CommandEventArgs e) at Janus.Windows.UI.CommandBars.UICommandCollection.c(Object , CommandEventArgs ) at Janus.Windows.UI.CommandBars.UICommand.OnClick(CommandEventArgs e) at Janus.Windows.UI.CommandBars.UICommand.ar() at Janus.Windows.UI.Internal.JNSCZ.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Janus.Windows.UI.Internal.JNSCZ.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Any ideas?
Cheers, Ian.
without the v2.6 project and the v3 project we can't say anything about it. The error suggests something is internally wrong, likely due to the conversion so we'd like to know how that happened.
Be sure to use the latest v2.6 conversion template btw.
I have tracked the problem down to an inheritance hierarchy between two entites. Funnily enough this is the same hierarchy that I was rambling on about in this thread...
http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=16603
I've created a new project with _just _the two entites and the error still persists upon an F7! The designer has even started crashing now when I click out of the error dialog. If one deletes the hierarchy the problem goes away. So why doesn't it like these views? Here's the project...
<?xml version="1.0" encoding="utf-8"?>
<!--LLBLGen Pro v3.0 project file. Do not manually edit this file. Incorrect references could lead to an unloadable project file.-->
<Project Version="3.0" TargetFrameworkName="LLBLGen Pro Runtime Framework">
<Properties>
<Abbreviations />
<Property Name="AdditionalTaskPerformerFolder" Value="" />
<Property Name="AdditionalTasksFolder" Value="" />
<Property Name="AdditionalTemplatesFolder" Value="" />
<Property Name="AdditionalTypeConverterFolder" Value="" />
<Property Name="AddNewElementsAfterRefresh" Value="0" />
<Property Name="AddNewFieldsAfterRefresh" Value="0" />
<Property Name="AddNewViewsAsEntitiesAfterRefresh" Value="0" />
<Property Name="AutoAddManyToManyRelationships" Value="false" />
<Property Name="AutoAssignSequencesToIntegerPks" Value="true" />
<Property Name="AutoAssignTypeConverterToFieldMapping" Value="false" />
<Property Name="CleanUpVsNetProjects" Value="true" />
<Property Name="ConnectionStringKeyNamePattern" Value="ConnectionString.{$ProviderName}" />
<Property Name="EncodingToUse" Value="0" />
<Property Name="EnforcePascalCasingAlways" Value="true" />
<Property Name="EntityFieldNameStripPattern" Value="{}{}" />
<Property Name="EntityNameStripPattern" Value="{tbl_}{}" />
<Property Name="ExcludableOrphanedElementDetectedAction" Value="3" />
<Property Name="FailCodeGenerationOnWriteError" Value="false" />
<Property Name="FieldMappedOntoRelatedFieldPattern" Value="{$RelatedFieldName}" />
<Property Name="FkFieldsAreNamedAfterTargetField" Value="true" />
<Property Name="ForeignKeyFieldPattern" Value="{$NavigatorName}{$RelatedFieldName}" />
<Property Name="GroupUsage" Value="0" />
<Property Name="IdentifyingFieldsFollowDBPrimaryKeyConstraints" Value="0" />
<Property Name="InsertUnderscoreAtWordBreakCaseSensitiveDBs" Value="false" />
<Property Name="LengthPrecisionScaleFollowDBLengthPrecisionScale" Value="0" />
<Property Name="MakeElementNamePascalCasing" Value="true" />
<Property Name="NavigatorMappedOntoManyToManyPattern" Value="{$EndEntityName}CollectionVia{$IntermediateEntityName$S}" />
<Property Name="NavigatorMappedOntoOneManyToOnePattern" Value="{$EndEntityName$S}" />
<Property Name="NavigatorMappedOntoOneToManyPattern" Value="{$EndEntityName$P}" />
<Property Name="NonExcludableOrphanedElementDetectedAction" Value="3" />
<Property Name="PreferDecimalOverCurrencyTypes" Value="true" />
<Property Name="PreferNaturalCharacterTypes" Value="true" />
<Property Name="PreferVariableLengthTypes" Value="true" />
<Property Name="ProjectCreator" Value="Ian Warburton" />
<Property Name="ProjectName" Value="TestProject1" />
<Property Name="RelationalModelDataElementNameCasingCaseSensitiveDBs" Value="3" />
<Property Name="RelationshipsFollowDBForeignKeyConstraints" Value="0" />
<Property Name="RemoveUnderscoresFromElementName" Value="true" />
<Property Name="RemoveUnmappedElementsAfterRefresh" Value="0" />
<Property Name="RetrieveDBCustomProperties" Value="false" />
<Property Name="RootNamespace" Value="" />
<Property Name="SequencePattern" Value="SEQ_{$EntityName}" />
<Property Name="SetGroupNameAfterSchemaName" Value="true" />
<Property Name="StoredProcNameStripPattern" Value="{pr_, sp_}{}" />
<Property Name="StoreTimeLastGeneratedIntoProject" Value="false" />
<Property Name="SyncMappedElementNamesAfterRefresh" Value="0" />
<Property Name="SyncRelationalModelDataElementNameAfterRename" Value="0" />
<Property Name="SyncRenamedMappedElementNamesAfterRefresh" Value="0" />
<Property Name="TypedViewFieldNameStripPattern" Value="{}{}" />
<Property Name="TypedViewNameStripPattern" Value="{vw_}{}" />
<Property Name="UniqueConstraintsFollowDBUniqueConstraints" Value="0" />
<Property Name="UpdateCustomPropertiesAfterRefresh" Value="0" />
</Properties>
<TypeShortcuts />
<CodeGenerationCyclePreferences>
<OutputType Value="3">
<LastUsedPreferences>
<DestinationRootFolder Value="" />
<FrameworkName Value="LLBLGen Pro Runtime Framework" />
<LanguageName Value="" />
<PlatformName Value=".NET 2.0" />
<PresetName Value="" />
<RootNamespace Value="" />
<TemplateGroup Value="" />
<TemplateBindings />
</LastUsedPreferences>
</OutputType>
</CodeGenerationCyclePreferences>
<CodeGenerationMetaDataDefaults>
<TargetElement Type="256">
<Defaults>
<Attributes>
<Attribute Value="Browsable($false)" />
</Attributes>
</Defaults>
</TargetElement>
</CodeGenerationMetaDataDefaults>
<EntityModel>
<ValueTypeDefinitions />
<EntityDefinitions>
<EntityDefinition Name="VwChaletEticket" InheritanceType="2">
<Fields>
<Field Name="Berth" Type="int" Precision="10" />
<Field Name="ChaletId" Type="int" Precision="10" />
<Field Name="Description" Type="string" MaxLength="50" />
<Field Name="ForSale" Type="bool" />
<Field Name="GuestCount" Type="int" IsOptional="true" Precision="10" />
<Field Name="InfoComplete" Type="bool" IsOptional="true" />
<Field Name="ParentEticketId" Type="int" IsOptional="true" Precision="10" />
<Field Name="Password" Type="string" IsOptional="true" MaxLength="50" />
</Fields>
</EntityDefinition>
<EntityDefinition Name="VwEticket" InheritanceType="2">
<Fields>
<Field Name="Date" Type="datetime" IsOptional="true" />
<Field Name="EntryFor" Type="int" IsOptional="true" Precision="10" />
<Field Name="EticketId" Type="int" Precision="10" IsPrimaryKey="true" />
<Field Name="EticketRef" Type="string" MaxLength="36" />
<Field Name="EventId" Type="int" Precision="10" />
<Field Name="LastDate" Type="datetime" IsOptional="true" />
</Fields>
</EntityDefinition>
</EntityDefinitions>
<Relationships />
<InheritanceHierarchies>
<InheritanceHierarchy SuperType=":VwEticket" SubType=":VwChaletEticket" />
</InheritanceHierarchies>
</EntityModel>
<TargetDatabases>
<TargetDatabase Type="2D18D138-1DD2-467E-86CC-4838250611AE">
<ConnectionElements>
<ConnectionElement Name="ServerName" Value="localhost" />
<ConnectionElement Name="CatalogName" Value="master" />
<ConnectionElement Name="UserID" Value="sa" />
<ConnectionElement Name="Password" Value="" />
</ConnectionElements>
<SystemSequences>
<Sequence Name="SCOPE_IDENTITY()" />
<Sequence Name="@@IDENTITY" />
</SystemSequences>
<Catalogs>
<Catalog Name="bangfaceweekender">
<Schemas>
<Schema Name="dbo">
<Views>
<View Name="vw_chalet_account">
<Fields>
<Field Name="AccountID" Ordinal="1" DbType="8" Precision="10" />
<Field Name="ParentAccountID" Ordinal="2" IsOptional="true" DbType="8" Precision="10" />
<Field Name="Password" Ordinal="3" IsOptional="true" DbType="24" Length="50" />
<Field Name="ChaletID" Ordinal="4" DbType="8" Precision="10" />
<Field Name="Berth" Ordinal="5" DbType="8" Precision="10" />
<Field Name="Description" Ordinal="6" DbType="24" Length="50" />
<Field Name="ForSale" Ordinal="7" DbType="2" />
<Field Name="GuestCount" Ordinal="8" IsOptional="true" DbType="8" Precision="10" />
<Field Name="InfoComplete" Ordinal="9" IsOptional="true" DbType="2" />
</Fields>
</View>
<View Name="vw_eticket">
<Fields>
<Field Name="AccountID" Ordinal="1" DbType="8" Precision="10" />
<Field Name="EventID" Ordinal="2" DbType="8" Precision="10" />
<Field Name="ETicketRef" Ordinal="3" DbType="24" Length="36" />
<Field Name="Date" Ordinal="4" IsOptional="true" DbType="4" />
<Field Name="LastDate" Ordinal="5" IsOptional="true" DbType="4" />
<Field Name="EntryFor" Ordinal="6" IsOptional="true" DbType="8" Precision="10" />
</Fields>
</View>
</Views>
</Schema>
</Schemas>
</Catalog>
</Catalogs>
</TargetDatabase>
</TargetDatabases>
<MappingStores>
<MappingStore Type="2D18D138-1DD2-467E-86CC-4838250611AE">
<EntityMappings>
<EntityMapping EntityName=":VwChaletEticket" TargetName="bangfaceweekender:dbo:vw_chalet_account">
<FieldMappings>
<FieldMapping FieldName="Berth" TargetFieldName="Berth" />
<FieldMapping FieldName="ChaletId" TargetFieldName="ChaletID" />
<FieldMapping FieldName="Description" TargetFieldName="Description" />
<FieldMapping FieldName="EticketId" TargetFieldName="AccountID" />
<FieldMapping FieldName="ForSale" TargetFieldName="ForSale" />
<FieldMapping FieldName="GuestCount" TargetFieldName="GuestCount" />
<FieldMapping FieldName="InfoComplete" TargetFieldName="InfoComplete" />
<FieldMapping FieldName="ParentEticketId" TargetFieldName="ParentAccountID" />
<FieldMapping FieldName="Password" TargetFieldName="Password" />
</FieldMappings>
</EntityMapping>
<EntityMapping EntityName=":VwEticket" TargetName="bangfaceweekender:dbo:vw_eticket">
<FieldMappings>
<FieldMapping FieldName="Date" TargetFieldName="Date" />
<FieldMapping FieldName="EntryFor" TargetFieldName="EntryFor" />
<FieldMapping FieldName="EticketId" TargetFieldName="AccountID" />
<FieldMapping FieldName="EticketRef" TargetFieldName="ETicketRef" />
<FieldMapping FieldName="EventId" TargetFieldName="EventID" />
<FieldMapping FieldName="LastDate" TargetFieldName="LastDate" />
</FieldMappings>
</EntityMapping>
</EntityMappings>
<TypedViewMappings />
<SPCallMappings />
<TypeConversionDefinitions />
</MappingStore>
</MappingStores>
<ModelViews />
</Project>
Fixed in next build. It was an oversight indeed: when one side is a view, no pk-fk field pairs are produced (naturally, as it's for creating an FK which requires both sides are a table), though there was no check for this, so it always passed the created set of pairs (which was empty in this case) to the checker.