The table represents the denomalized sensor - physicalinstrument
relationship only, all of the sensor data is duplicated over all of
the rows of the physical instruments and is supposedly the same for
all of the records. The valid from and to are part of the physical
instrument, while the name is part of the sensor object (and thus
duplicated over all of the records that represent the instruments.)

>From the sensor point of view, any of the records will do to retrieve
the data from, so the first would do indeed,
each record represents a physical instrument for the most part and
should as such be mapped to a physicalinstrument object, while being
added to the sensor's collection.





On Oct 9, 5:38 pm, Fabio Maulo <[email protected]> wrote:
> To understand my response you need to answer to my question.You have said :
> Sensors
>     STRING Name
>     …
>     DATETIME From
>     DATETIME To
>
> but PhyiscalInstruments is a collection so I'm supposing you want put there
> someone of the collection.
>
> 2009/10/9 Yves Goeleven <[email protected]>
>
>
>
>
>
>
>
> > Fabio, I don't quite understand your awnser...
>
> > Do you map the classes Sensor and PhysicalInstrument both to the same
> > table and use the component to be able to query for the correct
> > sensor?
>
> > On 8 okt, 21:09, Fabio Maulo <[email protected]> wrote:
> > > Which one of the list ?
> > > Sensor
> > > {
> > >  String Name
> > > IList<PhysicalInstrument> PhyiscalInstruments
> > > PhysicalInstrument TheFirst{ get{return PhyiscalInstruments[0];}}
>
> > > }
>
> > > <component name="TheFirst" class="PhysicalInstrument" access="readonly">
> > > <property......
> > > </component>
>
> > > from Sensor s where s.TheFirst.From > :pMinDate
>
> > > 2009/10/8 Yves Goeleven <[email protected]>
>
> > > > Hi,
>
> > > > I’m in a scenario where I have a denormalized table in the database,
> > > > where on the other hand in the domain model I’m more in a scenario of
> > > > a root object with children.
>
> > > > The object model looks like:
>
> > > > Sensor
> > > > {
> > > >    String Name
> > > >    …
> > > >    IList<PhysicalInstrument> PhyiscalInstruments
> > > > }
>
> > > > PhyiscalInstrument
> > > > {
> > > >     DateTime From
> > > >     DateTime To
> > > >     ….
> > > > }
>
> > > > The Table model looks like this:
>
> > > > Sensors
> > > >     STRING Name
> > > >     …
> > > >     DATETIME From
> > > >     DATETIME To
> > > >     ….
>
> > > > The model & table are little bit more complex, but this is the general
> > > > idea.
>
> > > > How can I solve this issue in NHibernate ?
> > > > What should the mapping files look like and how can I query to return
> > > > a Sensor object ?
>
> > > > Kind regards,
> > > > Yves
>
> > > --
> > > Fabio Maulo- Tekst uit oorspronkelijk bericht niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -
>
> --
> Fabio Maulo- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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