From: Vance K. <va...@us...> - 2006-02-20 08:37:41
|
User: vancek Date: 06/02/20 00:37:40 Modified: andromda-ejb3/src/site/xdoc howto5.xml Log: added info about enumeration type tagged value Revision Changes Path 1.2 +20 -2 cartridges/andromda-ejb3/src/site/xdoc/howto5.xml Index: howto5.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/xdoc/howto5.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- howto5.xml 8 Feb 2006 10:20:00 -0000 1.1 +++ howto5.xml 20 Feb 2006 08:37:40 -0000 1.2 @@ -54,11 +54,13 @@ <li class="gen"><a href="src/org/andromda/test/howto5/a/RentalServiceException.java.txt"><code>RentalServiceException.java</code></a></li> </ul> </p> + <a name="Literals"/> <subsection name="Literals"> <p> Note that in this example the enumeration attributes have been specified using regular variables - in Java notation, the <em>initial value</em> has been specified using capitals - (actually you would do this only when you want to have the value different from the attribute name): + in Java notation, the <em>initial value</em> has been specified using capitals. + Using the EJB3 cartridge, enum types ignore the attribute name. Therefore, in the EJB3 cartridge + you CANNOT have a value that differs from the attribute name. This option is not available. <source><![CDATA[ sedan : String = SEDAN liftback : String = LIFTBACK @@ -79,6 +81,22 @@ it is very easy in use too. </p> </subsection> + <a name="Enumeration_Types"/> + <subsection name="Enumeration Types"> + <p> + In the above diagram, the tagged value <code>@andromda.persistence.enumeration.type</code> + specifies the enumeration type for the <code>type</code> attribute of the <code>Car</code> + entity as <code>STRING</code> type. If your type-safe enumeration has attributes of + type String and you wish to use these literal names, then you must specify the + <code>@andromda.persistence.enumeration.type</code> tagged value on the entity attribute. + </p> + <p> + To use the ordinal values relating to the literals of the type-safe enumeration class, + you do not need to do model the <code>@andromda.persistence.enumeration.type</code> + tagged value. By default, if an entity attribute has an enumeration type, the ordinal + values of the enumeration literals are used. + </p> + </subsection> </section> <section name="Next"> <p> |