Pergunta

Still a n00b in NHibernate :(

I want to add a composite index to the hbm.xml of one of my POCOs, for performance purposes. It does not relate directly to a class, but rather two common values I will be querying against.

I think I need to do a <map></map> entry in the XML, but the XSD is asking for a class name on the composite-key element, and there is no direct relationship, per se... plus it's asking for more information than I think I would need to provide. How do I do this?

    <map name="PropertyKeys">
        <key>
            <column name="StockID" />
            <column name="PropertyName" />
        </key>
            <composite-index class="Something?">
                <key-property name="What goes here?" />
            </composite-index>
        <what else goes here?>
    </map>
Foi útil?

Solução

Have you read this http://ayende.com/blog/4045/nhibernate-mapping-map It explains when you would use a map and further on it explains the composite-index

However without more background info it is not 100% certain that you need a map!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top