Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Recent Topics
Advanced Search
Double, Long, Float, Custom Types--- Not Supported in Code Generation?  
Forum Index -> DB Visual ARCHITECT (DB-VA)
Author Message
sunilkroy


Joined: 2008/02/26
Messages: 7

Offline

When I Generate POJOs from DBVA 4.2, I get the following Error.

Class <<class-name's>>   attribute (<<attribute-name>> : java.lang.Double)   must specify a supported type.

I am getting these errors for   Long,   Double,   Float   and   Custom Data Types(Classes of our Model).

But java.math.BigDecimal and java.lang.Integer work fine.

I tried specifying these data types in the Modeling -> Application Options -> Data Types -> UML and also in Modeling -> Application Options -> Data Types -> Java.
But this did not help.

Any suggestions on how to resolve it? Requesting help on this.
 
Rain


Joined: 2005/04/29
Messages: 735

Offline

Hello sunilkroy,

Would you mind send me your project file to have a look? Thanks in advance!

Best regards,
Rain Wong
 
sunilkroy


Joined: 2008/02/26
Messages: 7

Offline

I am attaching a dummy project here with the same issues. I am getting these data type related errors while generating code (POJOs).
Please help.

DATA_TYPE_TEST_PROJECT.vpp
 Description It has 2 classes, Class1 and Class2. Class1 has attibutes with data types like java.lang.Double, java.lang.Float and java.lang.Long..... Class2 has an attribute of the type Class1. For these classes, I am getting Errors like java.lang.Long should be a Download
 Filesize 31 kb
 Downloaded:  67 time(s)

 
Jick


Joined: 2005/04/29
Messages: 2880

Offline

Hello sunilkroy,

There are 3 problems in your drawing.

Problem 1:
The attribute "class1" in class "Class2" cannot be typed as "Class1". If you want to relate this attribute with Class1, please use association instead.

Problem 2:
This is our mistake - The type for attribute cannot be fully qualified. If you want to use Long, type "Long" instead of "java.lang.Long". I already reported this problem to our team for bug fixing.

Problem 3:
Class1 need to be "ORM Persistable". You can set it by assigning it with "ORM Persistable" stereotype.

I am attaching an image to show you the correct way of drawing.

Best regards,
Jick

Attached Image : No description given (13 kb)


Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
LilianWong


Joined: 2008/02/22
Messages: 452

Offline

Dear sunilkroy,

I would like to notify you that the problem of code generating is fixed and deployed. You can download and try the build in the following link.
I hope this solves your problem.

http://files3.visual-paradigm.com/200803/Patch/sp1_20080311j/VP_Suite_Windows_3_2_sp1_20080311j.exe

Best regards,
Lilian Wong
 
sunilkroy


Joined: 2008/02/26
Messages: 7

Offline

Thank you very much, Jick & Wong.
You guys have been very helpful.

Just wanted to confirm that if Class A is required to have 3 attributes (after code generation) with the data type as Class B, then we should have 3 Relations from Class A to Class B, with the role names matching the required attribute names.

I tried this after Jick suggested that I should create a relation from Class A to Class B, instead of directly having an attribute with Type B, inside A.

I created 3 relations from A to B & I got 3 attributes (after code generation) in A, with Type B.

Is this the required approach?
 
Rain


Joined: 2005/04/29
Messages: 735

Offline

Hello sunilkroy,

Actually it is not necessary to have 3 association pointing to 3 attributes. By defining the name and type in association end already represent it will become an reference attribute in generated code. Defining both association end and attributes will only causing duplicated attribute. If you require any further information, please do not hesitate to contact me again.

Best regards,
Rain Wong
 
sunilkroy


Joined: 2008/02/26
Messages: 7

Offline

Oh, I think I did not explain properly.
When I created the 3 relations, I removed the 3 attributes from the model that were present earlier. Then, when I generated the code, I got those 3 attributes in the code.
What I really needed the confirmation for is whether it is fine to have 3 relations from Class A to Class B, or can there be any issues with that?
 
Rain


Joined: 2005/04/29
Messages: 735

Offline

It is absolutely fine to have 3 relationships from Class A o Class B. The meaning is just same as having 3 attributes in Class A which type is Class B.

Best regards,
Rain Wong
 
sunilkroy


Joined: 2008/02/26
Messages: 7

Offline

Thanks Wong, for heping.
 
 
   Forum Index -> DB Visual ARCHITECT (DB-VA)
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil