Generics Collection Type in POJO

How to make sure, the generated JAVA code uses generics for collection types ?


to generate the code like
{
       java.util.Set<ClassA> classAs;
       java.util.List<ClassB> classBs;
}

instead of 
{
       java.util.Set classAs;
       java.util.List classBs;
}


I have selected “Use Generic Collections” option in Modeling -> Application Options -> Eclipse. But still not getting the generics in the generated code.

Hi Rameshg,

Thanks for your post. The options at Modeling > Application Options > Eclipse is for code synchronization but not for ORM.

You need to select “Generics” in Association Handling in the Database Code Generation dialog box (see the image below).

If there is any further inquiry, please do not hesitate to contact me.

Best regards,
Lilian Wong


generics.png

Thanks. That helped.
If I set this option through ORM -> Generate Code, it works.

I was trying the same option through ORM -> ORM Wizard (Instead of Generate Code).
For some reason, even though I select “Generics” in the final dialog box of ORM Wizard , the generated code did not have generics.

I think the “Association Handling” option specified in the ORM Wizard is overridden by the option given in Generate Code dialog box in last run.

To recreate this problem try ORM -> Generate Code ( Association Handling = Standard ). And then ORM -> ORM Wizard ( Association Handling = Generics ). At this time, generated code does not have generics.

I am using the DBVA for Eclipse Version 4.2
Build : orm_mix_case_package_20080529

Hi Rameshg,

Thanks for your reply. I’ve forwarded this issue to our engineers to follow-up, and I’ll keep you informed for any news about this issue.

Best regards,
Lilian Wong

Hi Rameshg,

I’ve left a private message about the problem of code generation in ORM wizard, please check you private message box.

If you have any questions, please feel free to ask.

Best regards,
Lilian Wong