Create User Entity
This page provides directions to create the
User
entity using RSM.
We will create
User
in a package named org.andromda.timetracker.domain.
- In the TimeTracker model create a package called
domain
under
org.andromda.timetracker.
- In the Containment Tree on the left, right-click on the
domain
package
and selectNew Diagram > Class Diagram. The diagram is created and opened in a new window.
Type in
Domain Objects
as the name of this diagram and press Enter.
- Add a new class to the diagram and name it User.
- Add the stereotype called
Entity
to User.
- Add the 3 attributes to User.
- Open the
Stereotype
tab and apply the stereotype named
andromda_persistence_table. At the bottom of the stereotype panel,
you'll find the
Stereotype's properties
table. On the right of
andromda_persistence_table, Enter the value USERS.
This tagged value allows you to override the default table name for the entity.
-
Note: In our EMF-UML2 profile, each tag value has it own stereotype. Having such a stereotype
applied on an element will make AndroMDA consider this element tagged by the corresponding tag value.
If there is no specified value (but the stereotype is applied) AndroMDA will use the default value, defined
in the profile. Keep this in mind, to remove a tag value, unapply the stereotype.
- Make sure your class diagram matches the one shown on the right.
- Make sure that the RSM model explorer matches the screen shot shown below.
- Save your
timetracker
model by double-clicking on
timetracker.emx
and clicking on
File > Save
(Ctrl + S).
-
SelectFile > Export.... Choose
UML2 Model
and then click onNext.
As
source
select
/TimeTracker/timetracker.emx
and as
destination
browse to C:\timetracker\mda\src\main\uml.
Now go back to the main tutorial page and continue from where you left off.