I am currently designing a data warehouse and have had the most bizarre conversation with the lead developer who says it is not possible to write an ORM class for one of my tables. (Don't ask why he is writing an ORM class for a data warehouse )
So the table accepts delta loads from a source system
PK Source_ID Int
PK Load_Date DateTime
Field_1
Field_2
So the primary key of the table is the source id from the source system, and the datetimestamp.
Easy enough.
How is it hard to write an ORM class to represent one row?
Take the following example
Source_ID Load_Date Field_1 Field_2 Field_3
123 14/03/2010 09:00 ABC DEF GHI
123 14/03/2010 09:15 ABC DEF JKL
So he needs to write one ORM class for Source_ID with a collection of ORM classes (as a property of the first class) to represent each row for that source_id ordered in descending date order.
He could even add a flag to the constructor to indicate a kind of "lazy load" of only the latest row.
Anyone spot a problem with this?
So the table accepts delta loads from a source system
PK Source_ID Int
PK Load_Date DateTime
Field_1
Field_2
So the primary key of the table is the source id from the source system, and the datetimestamp.
Easy enough.
How is it hard to write an ORM class to represent one row?
Take the following example
Source_ID Load_Date Field_1 Field_2 Field_3
123 14/03/2010 09:00 ABC DEF GHI
123 14/03/2010 09:15 ABC DEF JKL
So he needs to write one ORM class for Source_ID with a collection of ORM classes (as a property of the first class) to represent each row for that source_id ordered in descending date order.
He could even add a flag to the constructor to indicate a kind of "lazy load" of only the latest row.
Anyone spot a problem with this?
Comment