Is there a trick to this? AFAICT, the query is asking the database to know about the link between the two tables without describing it. Perhaps inheritance isn't as automagical as I thought.
Postgres 8.3, 12/24 runtime libraries w/ 2.6 final generated code.
Using my DDL from http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=17424 I am doing an
adapter.DeleteEntitiesDirectly(typeof(ReportEntryEntity), B);
(B is a RelationPredicateBucket). It is failing, with the following exception:
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of an action query: ERROR: 42P01: missing FROM-clause entry for table "core_report_entries". Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> Npgsql.NpgsqlException:
missing FROM-clause entry for table "core_report_entries"
Severity: ERROR
Code: 42P01
at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext() in C:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 832
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1136
at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1154
at Npgsql.ForwardsOnlyDataReader.NextResult() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1340
at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1003
at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 589
at Npgsql.NpgsqlCommand.ExecuteNonQuery() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 493
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
--- End of inner exception stack trace ---
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteActionQuery(IActionQuery queryToExecute)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.DeleteEntitiesDirectly(String entityName, IRelationPredicateBucket filterBucket)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.DeleteEntitiesDirectly(Type typeOfEntity, IRelationPredicateBucket filterBucket)
Here is the diagnostic output
- Method Enter: DataAccessAdapterBase.DeleteEntitiesDirectly
-
Deleting entities of type: ReportEntryEntity
Method Enter: CreateDeleteDQ(6)
Method Enter: CreateSingleTargetDeleteDQ(3)
Generated Sql query:
Query: DELETE FROM "public"."report_entries" WHERE ( ( ( "public"."core_report_entries"."vessel" = :Vessel1 AND "public"."core_report_entries"."outage" =
utage2 AND "public"."core_report_entries"."calgroup_name" = :CalgroupName3 AND "public"."core_report_entries"."data_file_name" =
ataFileName4)))
Parameter: :Vessel1 : String. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: "11".
Parameter:
utage2 : String. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: "1R20".
Parameter: :CalgroupName3 : String. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: "SG11CCAL00004".
Parameter:
ataFileName4 : String. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: "DCR003C122I009".
- Method Exit: CreateSingleTargetDeleteDQ(3)
- Method Exit: CreateDeleteDQ(6)
- Method Enter: DataAccessAdapterBase.ExecuteActionQuery
- Method Enter: DataAccessAdapterBase.OpenConnection
- Connection physically opened.
Method Exit: DataAccessAdapterBase.OpenConnection
A first chance exception of type 'Npgsql.NpgsqlException' occurred in Npgsql.dll
A first chance exception of type 'Npgsql.NpgsqlException' occurred in Npgsql.dll
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll
Thanks