Book a Demo

Author Topic: string and DateTime not an available 'Type'  (Read 7915 times)

Tryst

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
string and DateTime not an available 'Type'
« on: January 04, 2008, 10:35:32 am »
Hi all,

When creating the attributes of a Class I would like to use 'string' and 'datetime' as possible 'Types' of an attribute but they are not in the dropdown list. I know I can enter the values, but I would like to select them from the dropdown list as its quicker.

Is there anywhere I can update the default set of values available in the dropdown list?

Thanks
Tryst

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #1 on: January 04, 2008, 11:30:16 am »
Make sure your class is set to a language that supports these datatypes - with the same spelling as you are using. EA defaults to Java.

[Actually, EA defaults to whatever you want. However, since EA copies each new project over from the EABase model, you'll inherit the setting from that project. The EA installation kit contains a copy of EABase that is set to Java. You can edit this file - it is in the EA installation directory - to set the default to something else.]

If that does not work, create your own classes of the types you want. You should be able to then see them in the drop-down when you create attributes in new classes.

HTH, David
No, you can't have it!

Tryst

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #2 on: January 05, 2008, 04:36:52 pm »
Hi Midnight and thanks for the reply.

I have managed to solve half my problem. Under Tools->Source Code Engineering->C# I have set 'Default Attribute Type' to 'string' :)
Tryst

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #3 on: January 06, 2008, 08:30:01 am »
Now check you default DBMS. You need to open the Settings | Database Datatypes dialog. You need to have a project open to access this dialog. Now open the Product Name drop-down. Select the DBMS product you are using for this project. You can now examine all the datatypes for that product.

You can check the Set as Default button to make this choice stick for future projects. For some reason known only to Sparx when this dialog opens it does not display either the DBMS product of the current project or the default DBMS. They have not seen fit to change this behavior. The side effect of this is that you need to use trial and error to 'discover' the current default DBMS - it will be the only one that has the Set as Default box checked.

HTH, David
No, you can't have it!

Tryst

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #4 on: January 06, 2008, 12:00:02 pm »
Hi Midnight,

I am going to be Generating C# code from these Classes (although the data for these Classes will be coming from an Oracle database), so do I still need to do what you suggested in your last post?

Thanks
Tryst

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #5 on: January 06, 2008, 01:56:05 pm »
Depends,

If you are creating a data model and then transforming it into an object model, then perhaps you do. If you are only creating an object model then you do not.

However, in the latter case you should not be using EA's Table element. You should be using a class. The Table element 'knows' it represents a DBMS table, and will cause its attributes to be Column elements. These in turn 'know' they are DBMS columns, and will use DBMS datatypes instead of those from your software language.

Does this help?

David
No, you can't have it!

Tryst

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #6 on: January 06, 2008, 02:39:47 pm »
They are set as Classes :)

Yes, that helps, David.

Thanks
Tryst

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: string and DateTime not an available 'Type'
« Reply #7 on: January 10, 2008, 03:02:47 am »
Why not just use the Settings/Code Datatypes... menu and then select C# you can add DateTime (you can add a UML platform independent map, say Date, as well)

string should already be there

Now when C# is the language for an element DateTime will be in the dropdown list.

You can also specify the type as System.DateTime

If you use MDA, then the UML Date type will convert to DateTime

You can add any other types in a similar manner

:)
Models are great!
Correct models are even greater!