Book a Demo

Author Topic: Where are the database types for the data model  (Read 8162 times)

m0

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Where are the database types for the data model
« on: June 04, 2008, 12:14:31 am »
Hello,

I recently perchased Entreprise Architect Professional, and when I create a database model I would like to add columns as any person would like to do.

When I double click on the table to goto its properties, I choose a table name and then I select Columns. After I choose columns I entered a column name but there are NO datatypes in the drop down list?

What should I do to see the datatypes? Or, did I buy the wrong version :x

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Where are the database types for the data mode
« Reply #1 on: June 04, 2008, 01:17:04 am »
Set the DBMS product in the table's property dialog.

You should think about setting a default DBMS. If you cannot find the necessary help page (it is there) search my posts for how to do so.
« Last Edit: June 04, 2008, 01:17:16 am by Midnight »
No, you can't have it!

m0

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Where are the database types for the data mode
« Reply #2 on: June 04, 2008, 01:37:39 am »
Quote
Set the DBMS product in the table's property dialog.

You should think about setting a default DBMS. If you cannot find the necessary help page (it is there) search my posts for how to do so.

Thanks midnight, found your post here: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1178287423/0#1

I guess I would have to redesign my tables again. The database types only show for newly created tables not for existing tables. I was hoping it would of let me choose the values but I would have to delete and create new.

Thanks for the info.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Where are the database types for the data mode
« Reply #3 on: June 04, 2008, 02:28:59 am »
Before you trash the whole model...

[Note: I have not tried this, so make a backup copy of your model if you decide to experiment.]

First create a new package to house your replacement model. Now create an empty table, named for one of the original set. Make sure the DBMS is set correctly.

Now see if EA will let you copy over the columns from the original table. Since tables and columns are just stereotyped classes and attributes, this might be possible. EA provides a shortcut for replicating a set of attributes in a new class.

In the Project Browser tree open up the original table. [If you cannot do so, you might need to adjust the maximum tree depth. The settings are on the Tools | Options dialog at the bottom of the General (the default) page.] Don't select the new table, and make sure your new diagram is still visible.

Now select the entire set of columns. Use control-click or shift-click to do so. EA can be a bit strange when you do this, but persevere and you'll get them selected.] Now drag (or control-drag) them to the new table you've created. [Check the EA help if this does not work at all. There is a way to do this, but I might have missed a detail or two.]

See if the newly added columns have picked up the DBMS type from the table. You might still need to set the data type - since you had nothing before - but if you had typed them in by hand (and did so correctly) they will likely be OK.

Please post back and let us know if this works.

David
No, you can't have it!

m0

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Where are the database types for the data mode
« Reply #4 on: August 15, 2008, 02:21:10 am »
I really don't know what is happening. I closed my project and reopened it, my default datasource is SQL Server 2005. And now each table  has Java as DB Version.

I have like 20+ tables and I can't generate DDL from them anymore :/

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Where are the database types for the data mode
« Reply #5 on: August 15, 2008, 05:14:33 am »
Try exporting the entire model to XMI, and editing the DBMS settings there. Then import the model - to a copy of your project in case of errors - to see if the changes stick.
No, you can't have it!

m0

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Where are the database types for the data mode
« Reply #6 on: August 15, 2008, 05:49:07 am »
Hi,

There are many places that say Java, I didn't see any DBMS settings there. But I saw,

EAJava_char, EAJava_int, etc... Then I saw some EAJavaTypesPackage etc. and <code product_name="Java"  and product_name="Java" gentype="Java" genfile

What do I rename it too? SQLSERVER ?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Where are the database types for the data mode
« Reply #7 on: August 15, 2008, 06:31:51 am »
I'm not quite sure of the correct name (or names) for SQL Server 2005.

Create a new empty project. Make sure you change the default database to SQL Server - see my note later in this post. Create an empty package and a new data model, then a new table. Make sure that the table is set to SQL Server 2005 as well. Now export that model and you should get the correct syntax.

NOTE: EA might store the default database on a per-project basis. One side effect of this is that you might inherit this setting every time you create a new project. [EA copies EABase.EAP each time you do this.] Check whether this is the case (I don't remember). If it is the case you have three options: change the value each time you create a project; edit and save EABase.EAP in your EA installation directory to use your preferred product (and remember to update the new model whenever Sparx issues a new base project; or use the Copy a Base Project link on the EA Start Page to create new projects based on your own customized 'seed' project.

Don't panic though. I think EA stores the default database setting in the registry, in which case it should be remembered next time you create a new project.
No, you can't have it!

m0

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Where are the database types for the data mode
« Reply #8 on: August 16, 2008, 12:46:54 am »
Replaced "Java" with "SQL Server 2005" but I realized something while importing. There is a combox drop down box that says:

"Treat imported datatypes as:" And I chose SQL Server 2005. And it converted them all to SQL. Kinda simple. Lets hope it doesn't change again.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Where are the database types for the data mode
« Reply #9 on: August 16, 2008, 12:52:00 am »
Once you coerce EA to the correct default DBMS when a project is started you should be OK. If EA sets the owning package to a different DBMS then you'll have problems with whatever you add to that package.

Test to make sure that you've got the correct DBMS with a new empty model, and then after adding a package. See the posts above for what to do if things are not set correctly.

David
No, you can't have it!

m0

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Where are the database types for the data mode
« Reply #10 on: August 21, 2008, 02:01:24 am »
It happened again. I am creating a table with two pk keys so (module_id, group_id) making them pk, and then foreign key them to another table for each key.

Then I removed the PK from them saved. Reopened, and it stated JAVA.

I tried reproducing it, and I couldn't.

It is somehow reverting to JAVA, don't ask me how :x The default database datatype is SQL SErver 2005. It still defaults to that with new tables.

Might be a small bug somewhere which some sequence of steps is reverting my db type selection
« Last Edit: August 21, 2008, 02:05:45 am by m0interactive »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Where are the database types for the data mode
« Reply #11 on: August 21, 2008, 03:39:55 am »
Try starting a completely new project and building your data model there.

Before you create the project, use one of the methods I've mentioned to make your DBMS the default for databases.

Now to the problem of Java. This is sort of related, but not the same problem. What's happening here is that EA is reverting to the default code generation language. This is a different setting in EA. EA stores the code (versus database) language in each project. Sounds OK at first, but there's a catch.

I'm going to go through this in detail, so please bear with me...

When you create a new project, EA actually creates a copy of a 'seed' project and stores it to the folder and file name you select. An analogous process is used for projects in DBMS repositories, in that EA requires that you copy the 'seed' data via a project transfer.

Whenever you create a new project it will inherit the code language setting from the seed project you used. If the seed project has a different default code language than you want, you'll need to change that setting every time you create a new project. More importantly, any pre-existing packages and elements will still have the previous setting, and would also have to be edited.

You can designate your seed project if you create a new project by clicking the Copy a Base Project link on the EA start page. However, this project would have to have the language set to your desired product or you'll have to go through the above hassle.

If you don't designate your own seed project, EA copies the EABase.EAP that is kept in your EA installation folder. This file is empty - it contains no packages or elements - but it does have a default code language set. The default setting is Java, which is propagated to all project files created from this seed. That is what's causing your problem.

You can get around this by editing EABase.EAP. If you change the code generation language (via the Tools | Options | Source Code Engineering dialog) and save the file, the new setting will be the default inherited by all new projects.

You could also make several seed projects - each a copy of EABase.EAP - and set them to different languages. You might also set other options to reflect common configurations in your shop. Then you can use the Copy a Base Project link to use one of these files as a project template. You can also use one of them as the source for the initial Project Transfer for a new DBMS repository.

In any case, make sure you start with a clean project set to default to both your DBMS product and code language.

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