These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Is this mapping possible?
PostPosted: Wed Aug 02, 2006 2:00 pm 
Newbie

Joined: Mon Jul 31, 2006 10:35 am
Posts: 3
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.