Im trying to add a parameter constraint configuration (a bean validation) on the create and edit method of the standrd AbstractFacade (as generated by NetBeans).
So I tried:
@Override
public void create(@WkTeilnahmePlanedResult WkTeilnahme entity) {
super.create(entity);
}
This returned the message
A method overriding another method must not alter the parameter constraint configuration when deploying it to Glassfish 4
So next try was
@Override
public void create(WkTeilnahme entity) {
checkedCreate(entity);
}
private void checkedCreate(@WkTeilnahmePlanedResult WkTeilnahme entity) {
super.create(entity);
}
which deploys without any problems ... but the validator is never called.
Can you tell me why?
BTW:
@Override
public void create(WkTeilnahme entity) {
throw new UnsupportedOperationException(
"Create not supported! Use checkedCreate() instead!");
}
public void checkedCreate(@WkTeilnahmePlanedResult WkTeilnahme entity) {
super.create(entity);
}
This works but isn't really very cool!