Applying [Where] attribute to a base (abstract) entity has no effect

If one applies [Where] attribute to a base (abstract) entity, it has no effect. It will not be applyed to the derived (concrete) entities.

Don't know if that's 'by design', if so, leave here an 'feature request' as I think it would be usefull, if possible.


Yes, it's by design, the documentation lists what's supported and what's not supported in AbstractEntity:

Not every mapping information can be used in abstract entities. In abstract entities you can map primitive type columns (using Column attribute), the entity id (like attributes Id and UnsavedValue), use attributed-based events, add attribute-based validation and use global filters (using attributes like FilterDef and FilterDefParam). Not supported: associations, table-specific mapping attributes like Table, Sequence, UniqueKey, DBIndex, ForeignKey, attributes related to inheritance strategy like Inheritance, DiscriminatorColumn, DiscriminatorValueand PrimaryJoinColumn.

We don't have intention to support Where attribute as the global filters play a similar role and are already supported.

1 Like

Thanks @wlandgraf. I'll try using Global Filters instead.

BTW. [Sequence] should be used in abstract/base entities since one can use the same sequence for many tables.


That's true, but we were afraid of users misusing it. Still under consideration, it doesn't hurt for users to define the specific sequence in each class, anyway. That's not something that affects the business logic of the application, and that's is the main purpose of AbstractEntity - to share Pascal code between entities, not just avoid typing.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.