[ http://jira.andromda.org/browse/HIB-120?page=comments#action_11776 ]
     
Carlos Cuenca commented on HIB-120:
-----------------------------------

hi Mathhias,

I think you should use the @andromda.hibernate.collection.index tagged value on 
the relationship in order to specify which field will be used as index for the 
list, as you can see from this extract of the template hibernate.hbm.xml.vm:


            <key foreign-key="$sourceEnd.foreignKeyConstraintName">
                <column name="$sourceEnd.columnName" 
sql-type="$sourceEnd.sqlType"/>
            </key>
#if ($otherEnd.indexedCollection)
            <index column="$otherEnd.collectionIndexName"#if($otherEnd.map) 
type="$otherEnd.collectionIndexType"#end/>
#end
            <one-to-many 
class="$otherEnd.type.fullyQualifiedEntityImplementationName"/>
        </$otherEnd.collectionType>

Carlos

> Ordered assoc generates *.hbm.xml that violates the DTD
> -------------------------------------------------------
>
>          Key: HIB-120
>          URL: http://jira.andromda.org/browse/HIB-120
>      Project: Hibernate Cartridge
>         Type: Bug
>     Reporter: Matthias Bohlen
>     Assignee: Carlos Cuenca

>
> I am working with a recent CVS snapshot (yesterday).
> In my model, I have a one-to-many composition between two entities (one 
> Instrument composes many Quotes). The composition is marked as ordered on the 
> Quote side. The generated Instrument.hbm.xml file violates the DTD. The 
> offending part is this:
> <list name="quotes" lazy="false" fetch="select" inverse="false" 
> cascade="all-delete-orphan">
>       <key foreign-key="QUOTE_INSTRUMENT_FKC">
>               <column name="INSTRUMENT_FK" sql-type="BIGINT"/>
>       </key>
>       <one-to-many class="net.marketstate.tradingmath.domain.QuoteImpl"/>
> </list>
> The error message of the XML plug-in in Eclipse is:
> Error - The content of element type "list" must match 
> "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)".
> It seems as if an "index" or "list-index" element is *required* before the 
> "one-to-many" element comes.
> When Hibernate loads the document, the XML parser rejects it and Hibernate 
> complains with "invalid mapping document".
> This seems to be an issue with Hibernate 3.
> Cheers...
> Matthias

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Andromda-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to