Hi,
I'm a bit stuck and would appreciate a pointer in the right direction. I have a particular table setup and I'm having trouble trying to work out how to emulate it in nhibernate.
The structure is basically a many-to-many relationship with some quirks. There is a table RssItem which has an id, title and a description. There is another table called Phrase which has an id and a phrase string.
Then there is the join table. The join table has 4 fields:
- RssItemId
- PhraseId
- NumberOfOccurrences
- TitleOrDescription
NumberOfOccurrences specifies how many times the phrase occurs in the rss item and TitleOrDescription specifies whether this join relates to the title field or the description field.
Because I'm used to thinking about a problem like this outside of an ORM tool, I'm not quite sure how I structure my nhibernate mappings so that I can effectively perform queries along the lines of:
- how many times was phrase X found in any description across all rss items?
- how many occurrences of phrase Y were in the title of RssItem K?
- which RssItems contained phrase X more than once in the description?
etc. You get the picture. Anyway, any advice would be appreciated.
|