Hi Flo,

if I understood the problem correctly, Measurand is a "value type" without a
reference to the Channel entity it belongs to. I set value type into quotes
because I don't believe that they qualify for a value type. I rather think
it should be an entity in the channel aggregate.

Anyway, Measurands have an implicit many-to-one-relation to Channel. You can
avoid the error above if you make this an explicit relation. Instead of
using HasMany on Channel, use BelongsTo on Measurand.
To display some measurands of a given channel, you should implement a method
like this in the Channel class:
public IEnumerable<Measurand> GetMeasurands(DateTime from, DateTime to)
{
  return new SimpleQuery<Measurand>("from Measurand m where m.Channel = ?
and SampleDate between ? and ?", this.Id, from, to).Execute();
}

-Markus

2009/4/21 Flominator <[email protected]>

>
> What do I have left after removing HasMany?
> Is there any documentation on this?
>
> On Apr 21, 10:18 am, Ayende Rahien <[email protected]> wrote:
> > Not if you have a collection of them.Remove the HasMany, basically
> >
> > On Tue, Apr 21, 2009 at 11:13 AM, Flominator <[email protected]>
> wrote:
> >
> > > Isn't this solution one directional?
> >
> > > On Apr 21, 10:10 am, Ayende Rahien <[email protected]> wrote:
> > > > Remove the collection, make the association one directional
> >
> > > > On Tue, Apr 21, 2009 at 11:05 AM, Flominator <
> [email protected]>
> > > wrote:
> >
> > > > > What should it be then?
> >
> > > > > On Apr 21, 9:47 am, Ayende Rahien <[email protected]> wrote:
> > > > > > Flominator,A collection that large shouldn't be a collection
> >
> > > > > > On Tue, Apr 21, 2009 at 10:42 AM, Flominator <
> > > [email protected]>
> > > > > wrote:
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to