-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Convert annotation's converter property should be Class<? extends AttributeConverter>, not Class (unsafe) #56
Comments
@glassfishrobot Commented |
@glassfishrobot Commented Class<? extends AttributeConverter> converter() default void.class; |
@glassfishrobot Commented
|
@glassfishrobot Commented |
|
Fixed in #487. |
Currently, the converter property for the @convert annotation is declared as follows:
However, along with just generally being unsafe ("safe" use would be Class<?>), this does not properly restrict the set of classes that can be specified. My understanding is that this MUST be a class that implements javax.persistence.AttributeConverter. Therefore, the converter property should be specified like so:
With this change, the developer will know at compile time if he has specified an incorrect class. Without this change, the developer will not know until he gets a runtime error, which is seriously less desirable.
The text was updated successfully, but these errors were encountered: