I have created a database view which consolidates data in a table using the SUM() aggregate function and a GROUP BY query. Consequently, the rows returned do not have an ID column (as one row is a summation of multiple rows in the associated table).
When I try to map this view, Aurelius throws an exception (Cannot find mapping [Id] on class Txxxx).
I understand that for tables Aurelius needs an Id column. Is there a way to let Aurelius know that the underlying data is read-only and get it to not require an Id column?
Or can you think of another 'trick' to make this work?
- Niels
The class looks like this:
[Entity, Automapping]
[Table('VIEW_CONSOLIDATED_BOOKINGS')]
TBooking = class( TORMEntity )
private
FBOOKING: integer;
FPROJID: integer;
FUSERID: integer;
FSTARTDATE: TDate;
public
property STARTDATE: TDate read FSTARTDATE write FSTARTDATE;
property PROJID: integer read FPROJID write FPROJID;
property USERID: integer read FUSERID write FUSERID;
property BOOKING: integer read FBOOKING write FBOOKING;
end;