-->
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.  [ 2 posts ] 
Author Message
 Post subject: many to many where ignored by freemarker template
PostPosted: Thu Jul 05, 2007 9:21 am 
Newbie

Joined: Thu Jul 05, 2007 9:09 am
Posts: 1
I'm trying to generate .hbm.xml files with many-to-many elements with "where" attribute, e.g.

Code:
<set name="localisedDescription" inverse="false" table="calls_ls">
            <key>
                <column name="call_id" not-null="true" />
            </key>
            <many-to-many entity-name="LocalisedString" [b]where="type_qname='cms:localisedDescription'"[/b]>
                <column name="ls_id" not-null="true" />
            </many-to-many>
        </set>


The problem is in set.hbm.ftl, lines 24-25:

Code:
<many-to-many
          entity-name="${property.getValue().getElement().getReferencedEntityName()}"> <#-- lookup needed classname -->



should read:

Code:
 
<many-to-many
       entity-name="${property.getValue().getElement().getReferencedEntityName()}"
   <#if property.value.manyToManyWhere?exists>
          where="${property.value.manyToManyWhere}"
   </#if>
   >



The problem may apply to other Collection types.

Hope this is useful. Can supply patch if required.

Dominic


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 10:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Create a JIRA entry. The patch and test would be helpful.


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.