Model Entity with Custom Column Types

tomcat-thumbVisual Paradigm support wide range of databases for user to model the data structure of their systems. Once the data model is done you can generate persistent layer source code in Hibernate and use it as the out-of-the-box data access layer for building your database applications. All the data types which covered by Hibernate are directly supported by Visual Paradigm. But what if your model involved some domain specific data type which not covered by Hibernate? In this case you can make use of the User Type property to model it. To model with non-supported column types:

 

  1. Make sure a default database had been selected for your project. You can specify the project database at Tools > DB > Database Configuration.

    Open Database Configuration dialog

    Open Database Configuration dialog

  2. Select the database which you are modeling with. Specify the database connection information if you also wish to generate database from your ER model.

    Specify the default database for your project

    Specify the default database for your project

  3. Press OK to close Database Configuration dialog.
  4. Right click on the column and select Open Specification from popup menu.

    Open specification dialog of the column

    Open specification dialog of the column

  5. Specify the custom column type in the User Type.

    Specify the custom type in User Type field

    Specify the custom type in User Type field

  6. Press OK to close the Column Specification.
  7. Right click on the blank area of the diagram and select Presentation Options > Entity Column Display Options > Show Column User Type.

    Change the presentation options of diagram to show user defined column type

    Change the presentation options of diagram to show user defined column type

  8. Now the column will display with the custom type you defined. When generate database the custom type will also be used.

    Column snow showing the custom type you specified

    Column snow showing the custom type you specified

Related Know-how

Related Link

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply