Hi,
I'm trying to get a Tag Cloud architecture working in NHibernate.
public class Tag : Entity
{
public virtual int Id { get; set; }
public virtual string Text { get; set; }
}
This table will map to a few entities in my schema so I don't want to add a collection to the Tag class for each association.
I do however want to query the tag entities and return count(*) across all joined tables. I could do this easily in SQL but i'm not seeing the light with NH just yet.
Started off writing some HQL.
select t.Text, count(t.Id)
from Tag t join ????
where t.Id= :tagid
group by t.Text
What do I join to? since in the object model the many-to-many bridge table has no class and no property, does this mean this can't work?
What would you suggest? Id be interested to see if this could be done in Criteria.
Many Thanks,
Ian