}
masterPlanningVariableDescriptor.addDependentPlanningVariableDescriptor(this);
String mappedByPropertyName = dependentPlanningVariableAnnotation.mappedBy();
if (!mappedByPropertyName.equals("")) {
Class<?> oppositeClass = variablePropertyDescriptor.getPropertyType();
PlanningEntityDescriptor oppositePlanningEntityDescriptor
= planningEntityDescriptor.getSolutionDescriptor().getPlanningEntityDescriptor(oppositeClass);
if (oppositePlanningEntityDescriptor == null) {
throw new IllegalStateException("The planningEntityClass ("
+ planningEntityDescriptor.getPlanningEntityClass()
+ ") has a DependentPlanningVariable annotated property (" + variablePropertyDescriptor.getName()
+ ") that refers to a mappedByPropertyName (" + mappedByPropertyName
+ ") on the oppositeClass (" + oppositeClass
+ ") that is not a PlanningEntity.");
}
PlanningVariableDescriptor mappedByPlanningVariableDescriptor
= oppositePlanningEntityDescriptor.getPlanningVariableDescriptor(mappedByPropertyName);
if (mappedByPlanningVariableDescriptor == null) {
throw new IllegalStateException("The planningEntityClass ("
+ planningEntityDescriptor.getPlanningEntityClass()
+ ") has a DependentPlanningVariable annotated property (" + variablePropertyDescriptor.getName()
+ ") that refers to a mappedByPropertyName (" + mappedByPropertyName