Hi Chad,

I'm using this project.properties:

maven.multiproject.includes=**/*project.xml
......

# Change this to generate to the correct MDA database mappings
# For MySql use: MySQL
# For Hypersonic use: HypersonicSql
# For Oracle9i use: Oracle9i
# sql.mappings=HypersonicSql
sql.mappings=MySQL 

# For MySql use: net.sf.hibernate.dialect.MySQLDialect
# For Hypersonic use: net.sf.hibernate.dialect.HSQLDialect
# For Oracle9i use: net.sf.hibernate.dialect.Oracle9Dialect
#hibernate.db.dialect=net.sf.hibernate.dialect.HSQLDialect
hibernate.db.dialect=net.sf.hibernate.dialect.MySQLDialect

And this is my Item.hbm.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!--
     Attention: Generated code! Do not modify by hand!
     Generated by: hibernate.hbm.xml.vsl in andromda-hibernate-cartridge.
  -->
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd";>

<hibernate-mapping default-cascade="none">
    <class name="com.mondial.testHibernate.test01.ItemImpl" table="ITEM">
        <id name="id" type="java.lang.Long" column="ID" unsaved-value="null">
            <generator class="native">
            </generator>
        </id>
        <property name="unique_id" type="java.lang.String">
            <column name="UNIQUE_ID" not-null="true" unique="false" 
sql-type="VARCHAR(255) BINARY"/>
        </property>
        <property name="Name" type="java.lang.String">
            <column name="NAME" not-null="true" unique="false" 
sql-type="VARCHAR(255) BINARY"/>
        </property>
        <property name="Description" type="java.lang.String">
            <column name="DESCRIPTION" not-null="true" unique="false" 
sql-type="VARCHAR(255) BINARY"/>
        </property>
        <property name="Price" type="int">
            <column name="PRICE" not-null="true" unique="false" 
sql-type="INTEGER"/>
        </property>
        <property name="size" type="int">
            <column name="SIZE" not-null="true" unique="false" 
sql-type="INTEGER"/>
        </property>
        <many-to-one name="shoppingCart" 
class="com.mondial.testHibernate.test01.ShoppingCartImpl" outer-join="auto" >
            <column name="SHOPPING_CART_FK"/>
        </many-to-one>

    </class>
</hibernate-mapping>

This is my hibernate-schema-initialize.sql:

create table ITEM (ID bigint not null auto_increment, UNIQUE_ID VARCHAR(255) 
BINARY not null, NAME VARCHAR(255) BINARY not null, DESCRIPTION VARCHAR(255) 
BINARY not null, PRICE INTEGER not null, SIZE INTEGER not null, 
SHOPPING_CART_FK bigint, primary key (ID)) <----- ERROR ERROR ERROR ERROR

Hope, it can help you.

Best regards

Anjarivo

-----Message d'origine-----
De : Chad Brandon [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 16 février 2005 16:26
À : Anjarivo Razafinimanana; andromda-user@lists.sourceforge.net
Objet : RE: [Andromda-user] (no subject)

I just tried what you did below and required is correctly returned as false
for the 0 end and * is correctly returned as many.  What cartridge are you
using and how is 0 being transformed into a multiplicity of 1?

-----Original Message-----
From: Chad Brandon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 16, 2005 7:07 AM
To: 'Anjarivo Razafinimanana'; 'andromda-user@lists.sourceforge.net'
Subject: RE: [Andromda-user] (no subject)

Hi Anjarivo,

It sounds like a bug, I'll fix it right now.  For now though...just model your
ShoppingCart end as 0..1 and it should work ok.

Chad

________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anjarivo
Razafinimanana
Sent: Wednesday, February 16, 2005 3:45 AM
To: andromda-user@lists.sourceforge.net
Subject: [Andromda-user] (no subject)

Hi !
 
In my B2C application, I have 2 classes : ShoppingCart and Item, and each
time I want to design this relation :
 
            ShoppingCart  (0) ---  -> (n) Item    (zero2many)
 
Magicdraw or AndroMda transform this in:
 
            ShoppingCart  (1) ---  -> (n) Item    (one2many)
 
To my mind, a 'ShoppingCart' knows how many items it has, whereas Items
don't have to know anything about 'ShoppingCart'.
 
Is it normal?
 
Thank your for your help.
 
I'm using Magicdraw 9.0 and  andromda-3.0-RC1-SNAPSHOT.
 
Regards
 
Anjarivo
 





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to