-->
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 a bug? many-to-many with schema values
PostPosted: Sat Dec 31, 2005 6:25 pm 
Newbie

Joined: Sat Nov 26, 2005 5:39 am
Posts: 5
Location: Cumbria, UK
Hi,

I've just been struggling to get Hibernate 3.1RC2 to work with SQLServer 2000 and came across a couple of issues when working with (quite simple) many-to-many relationships. I am using the schema (="catmgr") setting in the class level definition which works fine for ordinary table access by appending it to the tablename (="catmgr.RC_CATEGORY"). However, when doing it for many-to-many relationships, the schema is not prepended to the X-Ref table name (="RC_PRODUCT_CATEGORY"). I therefore have to add it manually to the set and many-to-many relationship to stop the Hibernate-generated SQL statement messing up.

from Category.hbm.xml:
Code:
<!-- products in this category -->
<set name="products" table="catmgr.RC_PRODUCT_CATEGORY" lazy="false" cascade="save-update">
   <key column="CATEGORY_ID"/>
   <many-to-many class="com.minimaster.catalogue.ibase.Product" column="PRODUCT_ID"/>
</set>


Can anyone confirm they have the same problem, and that it is a problem (and not me) - if so, I'll report a bug?

-david

P/S:
Also, for those having to use SQLServer 2000, if you have many-to-many relationships and are using Tomcat/JDBC (with JDBC level transactions), and aren't using lazy associations, then you'll need to add the SelectMethod=Cursor option to the connection configuration string so that it'll set up server-side cursors to cope with the complexity of loading *everything*.

From hibernate.cfg.xml:
Code:
<property name="connection.url">jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=*****;SelectMethod=Cursor</property>


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.