I have an entity and it seems like using DateTime as the Id would be a good suit, however I there is this strange feeling that that it might be a terrible idea ( tho i cant come up with any logical reason as to why),
This is an immutable object ( ie once the value is recorded it shouldn’t really change )
So DateTime as id field in NHibernate yay or Nay?
I would appreciate your comments on this
Bad idea.
Never, ever have unique id to have some meaning, cause meaning can change, some other constraint on meaning can also change, and id has to be just that, an id.
If you have to, you can put unique index on datetime field and use it in queries, but keep id as guid or autinc.