mapping 'value object' collection in (Fluent) NHibernate

Posted by adrin on Stack Overflow See other posts from Stack Overflow or by adrin
Published on 2010-05-17T16:01:50Z Indexed on 2010/05/17 22:41 UTC
Read the original article Hit count: 219

Filed under:
|
|

I have the following entity

public class Employee
{
   public virtual int Id {get;set;}
   public virtual ISet<Hour> XboxBreakHours{get;set}
   public virtual ISet<Hour> CoffeeBreakHours {get;set}
}

public class Hour
{
   public DateTime Time {get;set;}
}

(What I want to do here is store information that employee A plays Xbox everyday let's say at 9:00 13:30 and has a coffee break everyday at 7:00 12:30 18:00) - I am not sure if my approach is valid at all here.

The question is how should my (ideally fluent) mappings look like here? It is not necessary (from my point of view) for Hour class to have Id or be accessible from some kind of repository.

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about ddd