Book a Demo

Author Topic: forward engineer namespace problem  (Read 2615 times)

lpic

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
forward engineer namespace problem
« on: March 31, 2005, 05:17:02 pm »
hi there,

I am having problems with the java code generation. When specifing java object types ( like java.util.Collection ) as return types in operations, no import statement is generated for the java.util.Collection type. Hence it won't compile.

I have tried creating a object in the model called java.util.Collection but it is still not generating the correct package scope.

what have i missed?

thanks

-lp

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: forward engineer namespace problem
« Reply #1 on: March 31, 2005, 05:31:48 pm »
You have a couple of choices.

You could create in a seperate part of your model a package structure that corresponds to the parts of the Java framework that you need.  Then set the attribute types to those classes.

Alternatively specify the full name of the class you need as the type.

Still another option is to add the appropriate import statments to the Imports field on the generate dialog.

Just something to be aware of.  EA doesn't synchronise import statements.  You'll need to make sure that EA is set to overwrite existing source code.

Simon