[Uml-devel] Object A and B in association

Jonathan Riddell jr at jriddell.org
Tue May 20 17:15:06 UTC 2003


On Tue, 20 May 2003, Lea Anthony wrote:

> I'm creating a MySQL code generator and I'm looking at the association stuff.
> It seems that they are the same:
>
> a->getObjectA()->getName() : Test
> a->getObjectB()->getName() : Test
>
> I have 2 classes Test and Test2.

I did
@@ -635,6 +635,9 @@ void CppWriter::writeAssociationDecls(QP
                bool printRoleA = false, printRoleB = false;
                for(UMLAssociation *a = associations.first(); a; a =
associations.next())
                {
+                       kdDebug() << k_funcinfo << endl;
+                       kdDebug() << k_funcinfo <<
"a->getObjectA()->getName():" << a->getObjectA()->getName() <<
 endl;
+                       kdDebug() << k_funcinfo <<
"a->getObjectB()->getName():" << a->getObjectB()->getName() <<
 endl;
                        // it may seem counter intuitive, but you want to
insert the role of the
                        // *other* class into *this* class.
                        if (a->getRoleAId() == id)
@@ -696,7 +699,7 @@ void CppWriter::writeAssociationRoleDecl
        }
 }

to the cppwriter and it correctly prints out the names of the two classes.
You'll need to send us your actual code to be able to debug it more.

Do you know that there is already an SQL code generator in KDE's CVS
version (which is the version you need to be using if you're developing
for Umbrello 1).

Jonathan Riddell








More information about the umbrello-devel mailing list