private void sortFetchPaths(BeanDescriptor<?> d, OrmQueryProperties p, LinkedHashMap<String, OrmQueryProperties> sorted, boolean addId) { String path = p.getPath(); if (!sorted.containsKey(path)) { String parentPath = p.getParentPath(); if (parentPath == null || sorted.containsKey(parentPath)) { // off root path or parent already ahead in fetch order sorted.put(path, p); } else { OrmQueryProperties parentProp = fetchPaths.get(parentPath); if (parentProp == null) { ElPropertyValue el = d.getElGetValue(parentPath); if (el == null) { throw new PersistenceException("Path [" + parentPath + "] not valid from " + d.getFullName()); } // add a missing parent path just fetching the Id property BeanPropertyAssoc<?> assocOne = (BeanPropertyAssoc<?>) el.getBeanProperty(); if (addId) { parentProp = new OrmQueryProperties(parentPath, assocOne.getTargetIdProperty()); } else { parentProp = new OrmQueryProperties(parentPath, new LinkedHashSet<>()); } } sortFetchPaths(d, parentProp, sorted, addId); sorted.put(path, p); } } }
if (beanProp instanceof BeanPropertyAssoc<?>) { BeanPropertyAssoc<?> assocProp = (BeanPropertyAssoc<?>) beanProp; String targetIdProp = assocProp.getTargetIdProperty(); String manyPath = SplitName.add(path, assocProp.getName()); pathProps.addToPath(manyPath, targetIdProp);
private void sortFetchPaths(BeanDescriptor<?> d, OrmQueryProperties p, LinkedHashMap<String, OrmQueryProperties> sorted, boolean addId) { String path = p.getPath(); if (!sorted.containsKey(path)) { String parentPath = p.getParentPath(); if (parentPath == null || sorted.containsKey(parentPath)) { // off root path or parent already ahead in fetch order sorted.put(path, p); } else { OrmQueryProperties parentProp = fetchPaths.get(parentPath); if (parentProp == null) { ElPropertyValue el = d.getElGetValue(parentPath); if (el == null) { throw new PersistenceException("Path [" + parentPath + "] not valid from " + d.getFullName()); } // add a missing parent path just fetching the Id property BeanPropertyAssoc<?> assocOne = (BeanPropertyAssoc<?>) el.getBeanProperty(); if (addId) { parentProp = new OrmQueryProperties(parentPath, assocOne.getTargetIdProperty()); } else { parentProp = new OrmQueryProperties(parentPath, new LinkedHashSet<>()); } } sortFetchPaths(d, parentProp, sorted, addId); sorted.put(path, p); } } }
if (beanProp instanceof BeanPropertyAssoc<?>) { BeanPropertyAssoc<?> assocProp = (BeanPropertyAssoc<?>) beanProp; String targetIdProp = assocProp.getTargetIdProperty(); String manyPath = SplitName.add(path, assocProp.getName()); pathProps.addToPath(manyPath, targetIdProp);