views:

38

answers:

0

I have a custom CMS implementation where each article can be linked to a list of tags. the nh mapping for this part looks like this:

<bag name="Tags" lazy="true" table="CMS_Articles_Tags" cascade="all-delete-orphan" batch-size="10">
  <key column="article_id"/>
  <element column="tag" type="string"/>
</bag>

the rest of the mapping is not interesting. So a tag is not mapped in its own class or so cause i just need to get a list of strings back and the mapping above is good enough.

I am looking for a way to retrieve all tags from the db, but at the same time being able to restrict the number of tags i am gonna get back.

Is there any way to do this preferably not using native sql as I would like to benefit from caching and database-independency for this particular step.

Thanks a lot