Custom Annotations

Hi,

I’m an owner of VP UML Pro for Mac, and I’m currently developing a new hibernate layer for our application.
Therefore, I’m looking for a way to give a class attributes a custom annotation.
For example, I need to attach Hibernate Validator Annotations to the attributes, like @Range in the following code:


public class Address {

    @NotNull private String line1;
    private String line2;
    private String zip;
    private String state;
    
    @Length(max = 20)
    @NotNull
    private String country;

    @Range(min = -2, max = 50, message = "Floor out of range")
    public int floor;
}
 

All I would need is something like a new tabbed pane in the attribute specs editor, where one could write a custom annotation in a text field.
This text should then be placed by the orm code generator above the declaration field of the attribute (as shown in the example above).

This is feature would be very important to us, because due to our development process the data model changes quite often,
and we were hoping to speed up the changes with your product.

Hi BenBlock,

I’m sorry for my late reply! Thanks for your post and the suggestion, I’ve passed the issue to our development team to study the possibility to support this in the future. If there is any feedback, I’ll come back to you immediately.

If there is anything that I can do to help, please feel free to ask.

Best regards,
Lilian Wong

Hi BenBlock,

I would like to notify you that we will support customizing Java annotation in our coming release VP Suite 3.4, which will be available within this 2 months.

With this enhancement, you will be able to add annotations in the “Java Annotation” tab inside the specification dialog box of class / attribute. Take the attribute “floor” in your sample as example, you need to customize the annotation as shown as the attached image.

I’ve also left a private message to you regarding to this issue, please have a check. :slight_smile:

Once VP Suite 3.4 is released, I’ll come back to you immediately. If there is any further inquiry, please feel free to ask.

Best regards,
Lilian Wong


java_annotation.png

Hi Lilian Wong,

This looks really nice :shock:
I’ll give it a try as soon as i can to give you some feedback.

Best regards,
Ben Block

Hi Ben Block,

Thanks for replying. You are always welcome to give us your feedback about the new feature.

Best regards,
Lilian Wong

Hi Ben Block,

Sorry for my late notification about VP Suite 3.4 release, which is available on end of October already. You can get details of new features and enhancements of VP Suite 3.4 from http://www.visual-paradigm.com/product/news.jsp
And you can download current version from the Download site ( http://www.visual-paradigm.com/download/download.jsp?product=vpsuite ). Hope you enjoy this version!

Please feel free to contact me if you need any help.

Best regards,
Lilian Wong