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


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