Bugs item #652053, was opened at 2002-12-12 01:39
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=652053&group_id=40712

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 7
Submitted By: Andrea Aime (aaime)
Assigned to: Nobody/Anonymous (nobody)
Summary: Code generator doesn't work with Bag 

Initial Comment:
It seems that the code generator won't generate 
property and accessor methods for bags... the following
snippet:

<class name="it.satanet.ketpl.model.PriceListInventory"
         table="pricelist_inventory">
    <id name="id" column="id" type="long"
unsaved-value="null">
      <generator class="sequence"/>
    </id>
    <property name="date" column="pli_date" type="date"/>
    <property name="revision" type="integer"/>
    <bag role="lists" table="pl_inventory">
        <key column="inventory_id"/>
        <many-to-many
class="it.satanet.ketpl.model.PriceList"
column="pricelist_id" not-null="true"/>
    </list>
  </class>

is not code generated properly. Also, note that the
code generator forgets to add an emtpy line after
setters, so that setter and getter method for the
same property are contiguous (just a readability
problem)

----------------------------------------------------------------------

>Comment By: Gavin King (oneovthafew)
Date: 2002-12-25 15:47

Message:
Logged In: YES 
user_id=384580

Fixed in CVS.

P.S. Max, are your maintaining your codegen patch against 
current development? I hope so ... because we still have to 
integrate this at some stage .....

----------------------------------------------------------------------

Comment By: Max R. Andersen (maxcsaucdk)
Date: 2002-12-23 09:53

Message:
Logged In: YES 
user_id=18119

This is easily fixed.




Add this line:


doCollections(classElement, "bag", "java.util.Collection", 
"java.util.ArrayList");




into ClassMapping.java after the 3 other doCollections line.




Gavin, is this enough or do you want a patch ? (I haven't 
made the patch because my local codegenerator contains the 
not yet integrated codegen patch)


      


----------------------------------------------------------------------

Comment By: Andrea Aime (aaime)
Date: 2002-12-12 01:43

Message:
Logged In: YES 
user_id=617186

Ah ehm, sorry, the correct mapping is:

<class name="it.satanet.ketpl.model.PriceListInventory"
         table="pricelist_inventory">
    <id name="id" column="id" type="long" unsaved-value="null">
      <generator class="sequence"/>
    </id>
    <property name="date" column="pli_date" type="date"/>
    <property name="revision" type="integer"/>
    <bag role="lists" table="pl_inventory">
        <key column="inventory_id"/>
        <many-to-many
class="it.satanet.ketpl.model.PriceList"
column="pricelist_id" not-null="true"/>
    </bag>
  </class>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=652053&group_id=40712


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to