2012/9/20 Anthony Presley <[email protected]>

> We have a database table which has the following set up:
>
> CREATE TABLE attendance_block (start_date DATETIME, end_date DATETIME);
>
> One application writes to this database and stores the dates as Unix Epoch
> dates, which it uses in its program logic.
>
> Another program (which we can change and have the source code to) uses
> NHibernate DateTime types, and stores data in the database in "regular"
> datetime formats, ie "2012-09-22".
>

Different data format for different rows for same column -> truly horrible
idea!

Since you can't change the epoch-using application, you should change the
other one so that it too writes dates in epoch format. Implement IUserType
for this. You can continue to use .Net Datetime in you classes. (But you
should change it so that it _always_ writes/reads epoch, to avoid having
mixed data in the table.)


/Oskar

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to