Issue Details (XML | Word | Printable)

Key: CHB-69
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Darius Jockel
Reporter: Christian Groove
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Fornax Cartridge Hibernate

Parser does not provide for Associatan Class between two entity classes.

Created: 15/Sep/08 09:58 PM   Updated: 11/Oct/08 05:44 PM
Component/s: Generator
Affects Version/s: 1.7.0
Fix Version/s: 1.7.1

Time Tracking:
Not Specified

File Attachments: 1. JPEG File assocClassMisbehav.jpg (95 kB)
2. PNG File example-model.png (52 kB)

Environment: Kubuntu 8,04 (64Bit) // Topcased 2.1.0


 Description  « Hide
I am trying to establish an <<EntityRelaion>> between two Entity (here User and Group).
Since a User may be member of several Groups and a Group may be owned by some
Users i have to model a n:m relationship.

Any n:m relationship needs a specific association-class, that ties two pkey of each entity
class together in one instance of the association-class. In order to make this (normally
hiddwn entity) viewable, we could use AssociationClass acting as a Associating-edge.

The nice thing is: Topcased support this in the 2.1.0 Version, but the fornax parser
actually does not (sic). He tells me:

     [java] 9985 INFO CompositeComponent - CheckComponent: slot model check file(s): org::fornax::cartridges::uml2::hibernate::checks::Constraints org::fornax::cartridges::uml2::hibernate::checks::AssociationChecks
     [java] * * * Start Checks for model: null * * *
     [java] 10402 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.openarchitectureware.check.CheckComponent:
     [java] EvaluationException : Couldn't find type or property 'memberEnd'
     [java] org::fornax::cartridges::uml2::hibernate::checks::AssociationChecks.chk[1548,9] on line 41 'memberEnd'
     [java]
     [java] 10403 ERROR WorkflowRunner - Workflow interrupted. Reason: EvaluationException : Couldn't find type or property 'memberEnd'
     [java] org::fornax::cartridges::uml2::hibernate::checks::AssociationChecks.chk[1548,9] on line 41 'memberEnd'
     [java]
     [java] 10403 WARN WorkflowRunner - LNK_UserGroup->User: Not navigable association ends should have no role name [org.eclipse.uml2.uml.internal.impl.PropertyImpl@1abbec4 (name: user, visibility: private) (isLeaf: false) (isStatic: false) (isOrdered: false, isUnique: true, isReadOnly: false) (isDerived: false, isDerivedUnion: false, aggregation: none)]
     [java] 10404 WARN WorkflowRunner - Message evaluation returned null [org.eclipse.uml2.uml.internal.impl.PropertyImpl@17d7c7f (name: propertyDefinition, visibility: private) (isLeaf: false) (isStatic: false) (isOrdered: false, isUnique: true, isReadOnly: false) (isDerived: false, isDerivedUnion: false, aggregation: none)]
     [java] 10404 WARN WorkflowRunner - LNK_UserGroup->Group: Not navigable association ends should have no role name [org.eclipse.uml2.uml.internal.impl.PropertyImpl@1ba92db (name: group, visibility: private) (isLeaf: false) (isStatic: false) (isOrdered: false, isUnique: true, isReadOnly: false) (isDerived: false, isDerivedUnion: false, aggregation: none)]
     [java] 10442 ERROR WorkflowRunner - ERROR in Component of type org.openarchitectureware.check.CheckComponent
     [java] Couldn't find type or property 'memberEnd' [memberEnd] in workflow: CheckComponent: slot model check file(s): org::fornax::cartridges::uml2::hibernate::checks::Constraints org::fornax::cartridges::uml2::hibernate::checks::AssociationChecks
     [java] 10443 ERROR WorkflowRunner - ERROR in Component of type org.openarchitectureware.check.CheckComponent
     [java] Couldn't find type or property 'memberEnd' [memberEnd.exists(e|e.isNavigable())] in workflow: CheckComponent: slot model check file(s): org::fornax::cartridges::uml2::hibernate::checks::Constraints org::fornax::cartridges::uml2::hibernate::checks::AssociationChecks

I think a AssiciationClass helps me to defined Stereo-Attributes for this asso-Class and by this also for the
table, or does there exist another way to declare associative-class for to link two or more classes instances/rows.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Christian Groove added a comment - 15/Sep/08 10:20 PM
here is a screenshop of the assoc class

Darius Jockel added a comment - 16/Sep/08 09:08 AM
Hello Christian,

you can configure the columns of a n:m relationship by configure the association ends of the association.
Declare the ends as <<Field>> and customize the 'columnName' tagged value.

The link-table of the relation can be customized by setting the 'coll_table' tagged value of the <<EntityRelation>>

AssociationClasses are not used.

Are there any other questions regarding this issue?

Regards
Darius

Christian Groove added a comment - 16/Sep/08 11:09 AM
Salut Darius,

thanks for your immediate reply. Ok, i'll try you suggested solution.
Anyway, do you belive, that fornax will support for this UML 2.1 feature,
someday (or in 0.7.1).

Personnally, i would favour any graphical means supported by UML2
over any helping workaround by stereotype-attributes, because
the later behaves like additional information medium for artefacts, that
can not be expressed in UML.
But finally, association-link does describe n:m relationsships
as best as possible.

Do you belive, that this could be an argument, to support these
artefacts ?

Thanx for you help!!!!
Groovy

Darius Jockel added a comment - 16/Sep/08 11:44 AM
Hello Christian,

you are right that the modelling of bidirectional associations work very well with association ends.
But in the past this constrict was not supported by every uml2 modeling tool.

Therefore we desided to use stereotypes.

Now we have the (problem), that a solution is already implemented and used by others.

Therefore I think, this behavior should not be changed.

Regards
Darius

PS: In addition to that the navigation in an associationclass is complette different from associations,
as I can see from the errors thrown by the workflow. This would cause complete new templates and extensions.

Christian Groove added a comment - 17/Sep/08 02:24 PM
Salut Darius,

? Now we have the (problem), that a solution is already implemented and used by others

Just for fun i loaded a 2.1.0 Diagram with association classes into an old
1.3.0 Topcased tool. The funny think was: it was loaded corrector, but the
presentation of the diagramm was a little bit messed up.

The answer to this behaviour is quite simple. Loading and Datarepresentation
is done by a sparate UML projekt/componenten, that is also shipped with Eclipse.
Not surprisingly, some of the relation-ship attributes were set correctly.

Do you really thing that assoc classes looks so different like navigations ?

Christian Groove added a comment - 17/Sep/08 02:27 PM
(continued..)
....

What will you do, when Topcase 2.x will support for (UML: n-ary association) ?


A+
Groovy



Darius Jockel added a comment - 17/Sep/08 09:36 PM
Hello Christian,

first of all the cartridge is (should be) independent of any modelling tool.
Of cause, there are tools with different interpretations of the UML2 standard.
Also different version of the same tool handle things different.

Also there are different ways to express concepts of your domain (DSL).
In our case we desided to model an n:m reference by an association. Additional informations are
placed into tagged values.
Changing this behavior would change the DSL.
This imply a braking change.

Quote Christian: Just for fun i loaded a 2.1.0 Diagram with association classes into an old
1.3.0 Topcased tool.
I started with the 0.9.0 release of topcased :-)

Quote: What will you do, when Topcase 2.x will support for (UML: n-ary association) ?
Then we have a problem. But we can deside that the Fornax Hibernate Cartridge DSL forbit to draw associations with more then two ends.

The only way to integrate AssociationClasses is that this would be an alternative way to model bidirectional n:m references.
If you would provide a solution, I could build in this functionality.

Regards
Darius

Christian Groove added a comment - 17/Sep/08 09:58 PM
Salut Darius,
 
> you can configure the columns of a n:m relationship by configure the association ends of the association.
> Declare the ends as <<Field>> and customize the 'columnName' tagged value.

In this case Topcased user would habe to select the association-link and
assign one(!) column - name for both relational-attributes in both entity-classes.
Am i right ?


Groovy

Christian Groove added a comment - 17/Sep/08 10:14 PM
Salut Darius,

i testet now your solution ...

> The link-table of the relation can be customized by setting the 'coll_table' tagged value of the <<EntityRelation>>

In topcase i can not find the "coll_table", there is only a "coll table name" that is
irgnored by fornax.

Groovy

Darius Jockel added a comment - 17/Sep/08 10:16 PM
Example for n:m reference

Darius Jockel added a comment - 17/Sep/08 10:19 PM
Hallo Christian,

maybe the attatched figure illustrate the configuration.

> In this case Topcased user
No, not only Topcased users. All users should model in the same way.

Darius Jockel added a comment - 17/Sep/08 10:22 PM
Hello,

> In topcase i can not find the "coll_table", there is only a "coll table name" that is
irgnored by fornax.

In this cause you discovered a bug.
I will have a closer look at this.
The reference model is modeled with MagicDraw.
The tests for Topcased models are very rudimental.

Regards

Darius Jockel added a comment - 23/Sep/08 02:54 PM
The tagged value for configure the tabble name of an bidirectional n:m association is 'coll_tableName'
This tagged value can be used to set the table, if a collection should be mapped.

Please close this issue is everything work correct and reopen if the problem still exists.

Regards
Darius

Christian Groove added a comment - 11/Oct/08 05:44 PM
Salut Darius,

iff your profile will not support for a coll_tableName, i can
not selecct it out of my Topcased! As i mentioned before,
i can set a "coll table name", but this one is not recognized
by your transforming tool!

Simply saying: I can not use coll_tableName cause i
can not see it. I can only set "coll table name" !!!!

Thanks
Groovy