TAureliusDataset and Enumerated Types

I have an entity definition which I build into a package so I can load it into a TAureliusDataset and create the fields. The important part of the entity definition is

[Enumeration(TEnumMappingType.emString, 'None,Text,Graph,Table')]
  TDashboardDisplayType = (None, Text, Graph, Table);

  [Entity]
  [AutoMapping]
  [DiscriminatorValue('DASHBOARD')]
  TDashboardReport = class(TBaseReport)
  private
    FDashboardDisplay: Nullable<TDashboardDisplayType>;
  public
    property DashboardDisplay: Nullable<TDashboardDisplayType> read FDashboardDisplay write FDashboardDisplay;
   end;

However, when I load from the package and create the field this gives me an Integer field and not a string field.

When I use a TXDataWebDataset in a WebCore app, then this maps as a stringfield.

While it is easy enough to work with both in an isolated app, it would be useful if this was consistent to allow for shared units.

Is there a way to enforce the handling of enumerated types in either dataset?

The thing is they are different fields in Aurelius and Web Core. Aurelius deals with entities that are saved directly into the database. XData/Web core deals with objects retrieved from the REST server.

In TAureliusDataset, you can set the field name as "DashboardDisplay.EnumName", it will be the string field you are looking for.

Thanks, I'll give that a go

1 Like

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