Fabio doesn't sleep, he just lies in wait ready to pounce. :)

On Wed, Jun 17, 2009 at 12:15 AM, Dave <[email protected]> wrote:

>
> Thank you both for your super fast replys as usual.
>
> I will go down the DB view with value-object path.
> p.s Fabio  do you ever sleep no matter what time I post you reply with
> in minutes?
>
>
> On Jun 17, 8:46 am, Fabio Maulo <[email protected]> wrote:
> > +1 but without map it (value-object in this case)
> >
> > 2009/6/16 James Gregory <[email protected]>
> >
> >
> >
> > > Personally, as it's read only, I'd go with creating a view and mapping
> an
> > > entity to it. It depends what the system is as to how good an idea it
> is.
> >
> > > On Tue, Jun 16, 2009 at 11:41 PM, Dave <[email protected]> wrote:
> >
> > >> Hi,
> >
> > >> I have a generic pivot table that is used to store additional
> > >> attributes for a entity
> >
> > >> For example
> >
> > >> ADDITIONAL ATTRIBUTES TABLE
> > >> Typefk    |    EntityFk      |        Value
> > >> -----------------------------------------------
> > >> 1                    1                   Foo
> > >> 2                    1                   Bar
> > >> 1                    2                   Baz
> > >> 2                    2                   Qux
> >
> > >> TYPE TABLE
> > >> PK       |    Name
> > >> --------------------
> > >> 1             company_name
> > >> 2             account_number
> >
> > >> I want to select an Enity with these addtional attrubutes showing as
> > >> columns in a single row instead of multiple rows (a piviot).
> >
> > >> For Example get all info from Entity1 would return
> >
> > >> pk   |  company_name  |  account_number
> > >> 1           Foo                       Bar
> >
> > >> This is a READ ONLY system.  What the Best approach to do this?
> >
> > >> 1) Perform a piviot in the DB (stored proc or view) and use NHibernate
> > >> to map to it?
> > >> 2) Leave the DB and mappings as is but do the transformation in code
> > >> using the getters?
> > >> 3) Tell the DBA their design stinks and redesign the DB (not really an
> > >> option)
> > >> 4) Something else?
> >
> > >> Cheers
> > >> Dave
> >
> > --
> > Fabio Maulo
> >
>

--~--~---------~--~----~------------~-------~--~----~
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