Book a Demo

Author Topic: Modelling enums (as per java 5)  (Read 2322 times)

raj

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Modelling enums (as per java 5)
« on: March 01, 2005, 04:41:08 am »
I have upgraded to build 748 of EA 4.51 since that is what is stated as supporting Java 5 enum types.

I have an class call AbstractTransaction and I need to add

enum TransactionType {add, delete}

How do I create this (either on its own or as an attribute to class Foo). I have tried various methods but the generated code does NOT reflect java 5 compliance.

Cheers
-raj

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Modelling enums (as per java 5)
« Reply #1 on: March 02, 2005, 06:18:30 pm »
Create a class with the stereotype "enumeration".

"add" and "delete" will be attributes with the stereotype "enum".

However, it's not quite that simple unless you first update to build 749 because there was a problem with the class body template for enumerations.

If wanting to know how to model something so that it generates what you want my suggestion is to reverse engineer it and see what it looks like in your model.

Simon

pbober

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Modelling enums (as per java 5)
« Reply #2 on: March 06, 2005, 11:29:22 am »
I have Build 749, but I can't get this to work.  I listed the values as attributes of type int, but no code is generated.  Are there instructions somewhere?