Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySql 5.0
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I want to make searching in one of my data structures very fast using Dictinary but so far I couldn't find a way to implement it using Hibernate.
Here is one of my classes:
public class nomenclature_group : nomenclature_entry
{
private System.Collections.IDictionary childNodes;
public nomenclature_group() : base() {}
public System.Collections.IDictionary ChildNodes
{
get { return childNodes; }
set { childNodes = value; }
}
}
Basically I need to be able to do a fast search for a given childNode and I want the keys of my dictionary to be the names of the childNodes.
The relationship between nomenclature_group and childnode is many-to-many. I have table holding the nodes and a table holding the groups. Logically i have another table holding the many-to-many relationships.
The table has two columns - one for the IDs of groups and the other one for the IDs of nodes. Now comes the tricky part...
Here is my mapping of the groups class:
<joined-subclass name="Devorex.domainObjects.nomenclature_group, DevorexProdajbi" table="nomenclature_group" extends="Devorex.domainObjects.nomenclature_entry, DevorexProdajbi">
<key column="entry_uoid" />
<map name="ChildNodes" table="nomenclature_groupchildnodes">
<key column="group_uoid" />
<index column="????" type="?????"/>
<many-to-many class="Devorex.domainObjects.nomenclature_entry, DevorexProdajbi" column="child_uoid"/>
</map>
</joined-subclass>
The problematic line is : "<index column="???" type="???"/>"
I want to have as an index(key) of my Dictionary the name of each Childnode but I only have access to columns in table that I have specified in the <map> tag ("nomenclature_groupchildnodes"). So having the names of each Childnode as keys for my Dictionary seem impossible. I would appreciate someone else's view on this dilema.