Hello,
I would like to override a constraint in hibernate validator. Here is my base class:
@Entity
@Table(name = "Value")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "valueType", discriminatorType = DiscriminatorType.STRING)
public abstract class Value extends CommonTable
{
private String equation;
@SimpleEquation(equationType = EquationType.EQUATION)
public String getEquation()
{
return equation;
}
public void setEquation(String equation)
{
this.equation = equation;
}
}
I've got a child class where I want to specify that the equationType for equation field is EquationType.ANOTHER_EQUATION, something like this:
@Entity(name = "CharacteristicUpgradeValue")
@DiscriminatorValue("CharacteristicUpgradeValue")
public class CharacteristicUpgradeValue extends Value
{
@Override
@SimpleEquation(equationType = EquationType.COST_VALUE)
public String getEquation()
{
return super.getEquation();
}
}
this code throw an exception saying that I've got a org.hibernate.MappingException: Repeated column in mapping for entity (normal, due to the duplicate getter)
There is an @AttributeOverride in Hibernate/jpa but it seems to run only with column override and not this kind of attribute.
How can I do it ?
thanks