| Author |
Message |
|
2008/02/26 05:47
|
|
|
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.
|
|
|
|
 |
| |
|
2008/02/26 11:55
|
|
|
Rain
Joined: 2005/04/29
Messages: 711
Offline
|
|
|
|
Hello sunilkroy,
Would you mind send me your project file to have a look? Thanks in advance!
Best regards,
Rain Wong
|
|
|
|
 |
| |
|
2008/03/08 03:44
|
|
|
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.
| 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: |
28 time(s) |
|
|
|
|
 |
| |
|
2008/03/11 10:55
|
|
|
Jick
Joined: 2005/04/29
Messages: 2879
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 |
|
|
|
 |
| |
|
2008/03/17 16:44
|
|
|
LilianWong
Joined: 2008/02/22
Messages: 253
Offline
|
|
|
|
|
 |
| |
|
2008/03/18 04:05
|
|
|
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?
|
|
|
|
 |
| |
|
2008/03/18 10:46
|
|
|
Rain
Joined: 2005/04/29
Messages: 711
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
|
|
|
|
 |
| |
|
2008/03/19 00:33
|
|
|
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?
|
|
|
|
 |
| |
|
2008/03/19 13:53
|
|
|
Rain
Joined: 2005/04/29
Messages: 711
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
|
|
|
|
 |
| |
|
2008/03/20 01:56
|
|
|
sunilkroy
Joined: 2008/02/26
Messages: 7
Offline
|
|
|
|
|
 |
| |