[Uml-devel] [Bug 73632] attribute comments with sqlwriter produces invalid SQL

Sebastian Stein seb_stein at gmx.de
Sun Feb 1 23:49:03 UTC 2004

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

------- Additional Comments From seb_stein at gmx.de  2004-02-02 08:48 -------
Subject: Re: [Uml-devel]  attribute comments with sqlwriter produces invalid SQL

Riku Voipio <nchip at kos.to> [040202 08:30]:
> > Maybe this is a feature. Or how do you add things like NOT NULL? If you use
> > the comment, you can add it directly behind the column name and type.
> Thing like NOT NULL are not really comments they are vital part 
> of the data definition.

I know.

> It would be inconsistent to have varchar(200) (the field lenght) in the
> attribute type field, and other parts of definition in the comment field. 

Mmh, yes. So you would say if a not null is needed, you enter as datatype
"varchar(200) not null", right?

> Plus, where would put the REAL comments of the field, if the
> comment field becomes magically an semantic field.

This would be impossible.

> This bug is because the original author is passing first by value
> to printAttributes and uses it like it would be passed by reference.
> You will only notice this if you use attributes of diffrent scope
> (public, protected, private)

And what should change to an attribute if the scope changes?
> > You also have to 
> I didn't touch the FOREIGN KEY code - It was broken already.

Yes, I know.

> I don't really know what it is supposed to do, so I only fixed the
> attributes part.

But we should do it right, so the best thing would be to fix both parts.

> > Maybe you can start with making a class diagram and write down what sql code
> > you expect. 
> The problem is, that UML doesn't really support SQL-like relationships,
> it is ment more to c++/java style relationships. I need find an 
> UML+SQL book if I want to fix it more seriously.

Oh yes, but be prepared that this is a neverending topic. I also looked at
it and there are different approaches how to interpret relationships between
the classes. I mean attributes are easy, but relationships are more
difficulty, because there are several ways how to solve it. But please go
on, I'm really interested what you can find out.

More information about the umbrello-devel mailing list