private void loadNeighborChildren(Element element) throws DmException {
try {
if (entity.getConceptConfig() != null) {
NeighborsConfig neighborsConfig = entity.getConceptConfig()
.getNeighborsConfig();
TextHandler textHandler = new TextHandler();
for (IEntity config : neighborsConfig) {
NeighborConfig neighborConfig = (NeighborConfig) config;
if (neighborConfig.getType().equals("child")
&& neighborConfig.isInternal()) {
String neigborProperty = textHandler
.firstLetterToLower(neighborConfig.getCode());
Element neighborChildElement = element
.element(neigborProperty);
ConceptConfig neighborChildConceptConfig = (ConceptConfig) persistentModel
.getDomainModel().getModelConfig()
.getConceptsConfig().retrieveByCode(
neighborConfig.getDestination());
if (neighborChildConceptConfig != null) {
String neighborChildClassName = neighborChildConceptConfig
.getEntitiesClass();
IDomainModel domainModel = persistentModel
.getDomainModel();
IEntities neighborChildEntities = domainModel
.getModelMeta().createEntities(
neighborChildClassName);
String neighborCode = neighborConfig.getCode();
String setChildMethodName = "set"
+ textHandler
.firstLetterToUpper(neighborCode);
Reflector.executeMethod(entity, setChildMethodName,
neighborChildEntities);
XmlEntities neighborChildXmlEntities = new XmlEntities(
neighborChildEntities, persistentModel);