Added helper method to lookup for inverse relations regardless of the upper/lower case in the relation encoding
This commit is contained in:
parent
923c0ff803
commit
a69e57eecc
|
@ -158,6 +158,16 @@ public class ModelSupport {
|
|||
}
|
||||
}
|
||||
|
||||
private RelationInverse findInverse(String encoding) {
|
||||
return ModelSupport.relationInverseMap
|
||||
.entrySet()
|
||||
.stream()
|
||||
.filter(r -> encoding.equalsIgnoreCase(r.getKey()))
|
||||
.findFirst()
|
||||
.map(r -> r.getValue())
|
||||
.orElseThrow(() -> new IllegalArgumentException("invalid relationship: " + encoding));
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method: fina a relation filtering by a relation name
|
||||
* @param relationName
|
||||
|
|
Loading…
Reference in New Issue