Warnings produced by generated code

Posts   
 
    
Helene
User
Posts: 11
Joined: 14-May-2008
# Posted on: 30-May-2008 08:21:21   

// Code is generated using LLBLGen Pro version: 2.5 // Code is generated on: // Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20

We use LLBLGen 2.5 with Oracle, and have the following situation:

All tables have a secondary key called "DIPSID", with a unique constraint. This is never the primary key of the table. In some cases we wish to use inheritance in LLBLGen. E.g. a table called Patient inherits from another table called Person.

In this setting for both entities a method

public IPredicateExpression ConstructFilterForUCDipsid()

is generated. This causes the following warning:

'xx.Generated.EntityClasses.PasientEntity.ConstructFilterForUCDipsid()' hides inherited member 'xx.Generated.EntityClasses.PersonEntity.ConstructFilterForUCDipsid()'. Use the new keyword if hiding was intended.

We do not want any warnings at all from our code, including generated code. Do you have any recommendation for how to fix this? Having to edit generated code each time it is generated is highly unwanted as well, we do want a better solution simple_smile

With regards Helene

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 30-May-2008 10:45:26   

That's because you have the same field (Dipsid) defined in PasientEntity and in PersonEntity, taking into consideration that PasientEntity inherits from PersonEntity.

So practically speaking you don't need the field to be defined in the subType, if it already exists in the SuperType.

Speaking about compilation, this would result in a name clash, which would generate the above mentioned warning to tell you a method in the subClass (ConstructFilterForUCDipsid) would hide an inherited method in the base class.

To avoid this either don't define the field in the subType (I see no use of it). Or rename it at one side. Note: if you don't want to rename the field in the database, it can be named in the object model i.e. from the Designer).

Otherwise if you insist on leaving the design as it is, then the warning is inevitable.