The field name 'xxxx' isn't known in the element 'xxxxEntity'.

Posts   
 
    
clint
User
Posts: 150
Joined: 15-Nov-2005
# Posted on: 08-Oct-2010 23:51:29   

Using LLBLGen 2.6. Using Adapter template.

I get the following error when trying to fetch a collection of "TaxPayment" entities:

The field name 'Reference' isn't known in the element 'TaxPaymentEntity'.

What does this error mean? The Reference field exists in the TaxPayment table. The TaxPaymentEntity class has code for the "Reference" field.

I used to be able to fetch TaxPaymentEntity in the past. This problem happened after I added the "Reference" field to the "TaxPayment" table and regenerated the code.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Oct-2010 12:14:57   

Do you have some fields mapped onto related entities is LLBLGenPro Designer?

Please post the code's lines that triggers that error. Also please post the exaca exepction and stack race.

David Elizondo | LLBLGen Support Team
clint
User
Posts: 150
Joined: 15-Nov-2005
# Posted on: 11-Oct-2010 17:07:26   

daelmo wrote:

Do you have some fields mapped onto related entities is LLBLGenPro Designer?

Please post the code's lines that triggers that error. Also please post the exaca exepction and stack race.

Here is the "Files on relations" tab in the LLBLGen designer:


FieldName                             Relation                                                           Hidden
Assessment                         TaxPayment-Assessment(m:1)                         False
TaxPaymentTransactionMap  TaxPayment- TaxPaymentTransactionMap(1:1) False
TaxPaymentVoidMap             TaxPayment-TaxPaymentVoidMap(1:1)          False
TaxPaymentVoidMap_          TaxPayment-TaxPaymentVoidMap(1:1)            False

I should explain that TaxPaymentVoid map is a table that maps one tax payment to another tax payment. It shows that one tax payment voids another tax payment.

Here is the call that triggers the error:

GlobalDBConnection.GetAdapter().FetchEntityCollection(taxPayments, bucket, -1, sortingSpec.GetLLBLGenSortExpression());

I should explain that GlobalDBConnection.GetAdapter() just returns a DataAccessAdapter object. sortingSpec.GetLLBLGenSortExpression() creates an ISortExpression. In this situation I'm NOT sorting by the Reference field. In fact none of the code I wrote uses these new fields.

Here is the exception:


The field name 'Reference' isn't known in the element 'TaxPaymentEntity'\r\nParameter name: fieldName

Here is the stack trace

   at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceInfoProviderBase.GetFieldPersistenceInfo(String elementName, String fieldName)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetFieldPersistenceInfo(IEntityField2 field)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetFieldPersistenceInfos(IEntityFields2 fields)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollectionInternal(IEntityCollection2 collectionToFill, IRelationPredicateBucket& filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses)
   at GCS.SharedBL.TaxPaymentManager.GetTaxPaymentsForAssessment(Int32 assessmentId, EntityCollection`1& taxPayments, SortingSpecification sortingSpec, Boolean postedOnly, Boolean excludeVoids) in D:\PROJECTS\GCSLRMS_DotNet\SharedBusinessLogic\GCS.SharedBL\GCS.SharedBL\TaxPaymentManager.cs:line 742
   at GCS.SharedBL.TaxPaymentManager.FillTaxPaymentsForAssessment(AssessmentEntity assessment, SortingSpecification sortingSpec, Boolean postedOnly, Boolean excludeVoids) in D:\PROJECTS\GCSLRMS_DotNet\SharedBusinessLogic\GCS.SharedBL\GCS.SharedBL\TaxPaymentManager.cs:line 822
   at GCS.SE.BL.Taxation.SumUpTaxPayments() in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\Taxation.cs:line 1249
   at GCS.SE.BL.Taxation..ctor(AssessmentEntity assessment, DateTime maxPaymentDate, Boolean excludeCountyPayments) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\Taxation.cs:line 107
   at GCS.SE.BL.SummarizeTaxPaymentsBalances.GetTotals() in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\SummarizeTaxPaymentsBalances.cs:line 267
   at GCS.SE.BL.SummarizeTaxPaymentsBalances..ctor(Int32 municipalityID, Int32 year, Nullable`1 realEstate, Boolean munPaymentsOnly, DateTime maxPaymentDate) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\SummarizeTaxPaymentsBalances.cs:line 53
   at GCS.SE.App.Controllers.JanuarySettlementController.GetLeviesAndCollections(SettlementJanuaryEntity& jan, DateTime maxPaymentDate) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.App\Controllers\JanuarySettlementController.cs:line 810
   at GCS.SE.App.Controllers.JanuarySettlementController.DefaultDataForSettlement(DateTime maxPaymentDate) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.App\Controllers\JanuarySettlementController.cs:line 277
   at GCS.SE.App.Forms.FormMaintainSettlement.button_GetData_Click(Object sender, EventArgs e) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.App\Forms\FormMaintainSettlement.cs:line 925
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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)

As I said before, all this code used to work fine until I added new fields to the TaxPayment table (Reference and TransactionID) and regenerated the LLBLGen code.

Thanks.

clint
User
Posts: 150
Joined: 15-Nov-2005
# Posted on: 11-Oct-2010 18:05:35   

Never mind. I regenerated the code and recompiled my project and now everything works.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 12-Oct-2010 03:09:03   

Good wink

David Elizondo | LLBLGen Support Team