-->
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: many-to-many Lists
PostPosted: Wed May 02, 2007 11:05 am 
Newbie

Joined: Mon Apr 17, 2006 6:18 pm
Posts: 12
Hi there,

is there a cheap way to map a many-to-many relationship as a list?

I've got a table like this:

ID | POSITION | VALUE


And there is a many-to-many relationship to this table. As a set this works fine, but now I want to make it as a list, thats sorted by POSITION.

If I make it like this:

<list name="customerCards" table="BR_CUST_CARD_X_SMD">
<key column="ID" />
<list-index column="POSITION" base="1" />
<many-to-many column="BCC_GCC_ID"
class="de.ethalon.AnyClass" />
</list>

Hibernate tells me:

org.hibernate.HibernateException: Missing column: POSITION
at org.hibernate.mapping.Table.validateColumns(Table.java:212)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:965)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:297)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at de.ethalon.priamos.data.SessionFactoryTool.getSessionFactory(SessionFactoryTool.java:130)
at de.ethalon.test.TestBranch.main(TestBranch.java:34)


Can anybody tell me, how to map this right? Is it possible?

Bye Michael


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.