I am having trouble generating code from a class diagram that uses enumerations.
A class i’ve created must have an attribute that will contain a value from an enumeration. I have a class called Cart that should have an attribute named codeType. The value of the codeType must be one of the values defined in an Enumeration.
My class diagram is looking like this:
Using the Wizard from Tools->ORM->Wizards I attempt to generate the Java code for this. The code generation fails with the message: Please synchronize association between Cart and CartCodeTypes classes.
How do I make this work? The bottom line is that i’d like to constrain the values of a class attribute to a set of values I define. I’m attempting to do this by using an enumeration, but are there other/better solutions?
Thanks for any help.