How to create embedded object

Hi.
I have the following problem.
I want to create class ‘Car’ which has a variable ‘myPosition’ of the Position type.

(illustration1)

The problem is that when I generate DAO , the Position class should not include the ID variable, but the Visual Paradigm generates it automatically.

I don’t know how I can solve this problem in Visual Paradigm.
Do I have to use UserType? - how?
Is there a possibility to include ID only in mapping files?
Or some Embedded attribute - how?

As a result I’d like to have something like that: (illustration2)

I don’t know how I can do this. I have several classes that I must use and have the same problem (not add ID).
Please help.


dbTable.JPG

vpdiagram.JPG

Hi Escx,

Thanks for your post. In your design (llustration1), you use normal association so it will generate table for ORM class “Position”. You need to create ORM Component Class from ORM class “Car” (you can select resources icon Composition > ORM Component Class, as shown as attached image).

Attached you can find the sample project based on your design, but the ORM class “Position” is created as ORM Component Class (from “Car”), and it will not generate table of Position (so no ID variable for Position). Hope this helps. Please let me know if there is any further question.

Best regards,
Lilian Wong

create_orm_component_class.png
orm.vpp

Hi.
I have another problem.
When creating a diagram: (illustration1) , entity Temp in ERD is created fine.

However, when I did the same with the following diagram: (illustration2)
The ERD diagram had errors: (illustration3)
I don’t know why these fields:
-waterTrackIdentifier
-trackwidth
from ManoeuvreArea class are now in entity TEMP2 instead of only in TEMP??
Field ID from Field class is now in entity TEMP instead of only in TEMP2…

What am I doing wrong?
What association should I use so that the generated diagram won’t contain any bad fields?

Does anyone have a clue how to solve this problem?
Thanks in advance for your time and thoughts
I’m using VP-PE v4.0 sp1_20090718

Regards,
Escx


ERD2.jpg

ClassDiagram2.jpg

ClassDiagram1_-_ERD1.JPG

Hi Escx,

Thanks for your post. I’m sorry that I cannot repeat your problem. Would you mind to remove your entity models from project (please ensure you cannot see them in Model Explorer after removed, otherwise, you will get an empty ERD after synchronized from class diagram), then synchronize from your class diagram again to ERD and see if the ERD becomes correct?

Best regards,
Lilian Wong

Hi Lilian,

Thanks for your reply.
I created a new project, synchronized from my class diagram to ERD and still have the same problem.
Attached you can find my sample project.
Thank you in advance for any help.

Regards,
Escx
simpleProject.zip

Hi Lilian,

Thanks for your reply.
I created a new project, synchronized from my class diagram to ERD and still have the same problem.
Attached you can find my sample project.
Thank you in advance for any help.

Regards,
Escx
simpleProject.zip

Hi Escx,

Thanks for replying with the project file. I’ve forwarded the issue to our engineers to follow-up, and I’ll let you know once there is any news.

Best regards,
Lilian Wong

Any news?
We are facing the same problem