protected String propertyNestedPath(String propertyName, BeanDescriptor<?> desc) { if (propertyName != null) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(propertyName); if (elProp != null && elProp.containsMany()) { return SplitName.begin(propName); } } return null; }
/** * Sort the fetch entries taking into account fetchPreference on the path. */ private List<FetchEntry> sortByFetchPreference(BeanDescriptor<?> desc) { List<FetchEntry> entries = new ArrayList<>(fetchPaths.size()); int idx = 0; for (Map.Entry<String, OrmQueryProperties> entry : fetchPaths.entrySet()) { String fetchPath = entry.getKey(); ElPropertyDeploy elProp = desc.getElPropertyDeploy(fetchPath); if (elProp == null) { throw new PersistenceException("Invalid fetch path " + fetchPath + " from " + desc.getFullName()); } entries.add(new FetchEntry(idx++, fetchPath, elProp, entry.getValue())); } Collections.sort(entries); return entries; }
@Override public String getDeployWord(String expression) { if (expression.equalsIgnoreCase(beanDescriptor.getName())) { return beanDescriptor.getBaseTable(); } ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression); if (elProp != null) { return elProp.getDbColumn(); } else { return null; } }
@Override public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) { if (propMap != null) { for (String propertyName : propMap.keySet()) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(propertyName)); if (elProp != null && elProp.containsMany()) { manyWhereJoin.add(elProp); } } } }
@Override public String nestedPath(BeanDescriptor<?> desc) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(lowProperty)); if (elProp != null && elProp.containsMany()) { // assumes highProperty is also nested property which seems reasonable return SplitName.begin(lowProperty); } return null; }
@Override public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(lowProperty)); if (elProp != null && elProp.containsMany()) { manyWhereJoin.add(elProp); } elProp = desc.getElPropertyDeploy(name(highProperty)); if (elProp != null && elProp.containsMany()) { manyWhereJoin.add(elProp); } }
@Override public String getDeployWord(String expression) { ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression); if (elProp == null) { return null; } else { if (catchFirst && firstProp == null) { firstProp = elProp; } addIncludes(elProp.getElPrefix()); return elProp.getElPlaceholder(encrypted); } }
@Override public boolean isEmbeddedPath(String propertyPath) { ElPropertyDeploy elProp = getElPropertyDeploy(propertyPath); if (elProp == null) { throw new PersistenceException("Invalid path " + propertyPath + " from " + getFullName()); } return elProp.getBeanProperty().isEmbedded(); }
/** * Check the logical property path for containing a 'many' property. */ protected void propertyContainsMany(String propertyName, BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) { if (propertyName != null) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(propertyName); if (elProp != null) { if (elProp.containsFormulaWithJoin()) { // for findCount query select clause manyWhereJoin.addFormulaWithJoin(propertyName); } if (elProp.containsMany()) { // for findCount we join to a many property manyWhereJoin.add(elProp); if (elProp.isAggregation()) { manyWhereJoin.setAggregation(); } } } } }
/** * Sort the fetch entries taking into account fetchPreference on the path. */ private List<FetchEntry> sortByFetchPreference(BeanDescriptor<?> desc) { List<FetchEntry> entries = new ArrayList<>(fetchPaths.size()); int idx = 0; for (Map.Entry<String, OrmQueryProperties> entry : fetchPaths.entrySet()) { String fetchPath = entry.getKey(); ElPropertyDeploy elProp = desc.getElPropertyDeploy(fetchPath); if (elProp == null) { throw new PersistenceException("Invalid fetch path " + fetchPath + " from " + desc.getFullName()); } entries.add(new FetchEntry(idx++, fetchPath, elProp, entry.getValue())); } Collections.sort(entries); return entries; }
protected String propertyNestedPath(String propertyName, BeanDescriptor<?> desc) { if (propertyName != null) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(propertyName); if (elProp != null && elProp.containsMany()) { return SplitName.begin(propName); } } return null; }
@Override public String getDeployWord(String expression) { if (expression.equalsIgnoreCase(beanDescriptor.getName())) { return beanDescriptor.getBaseTable(); } ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression); if (elProp != null) { return elProp.getDbColumn(); } else { return null; } }
@Override public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) { if (propMap != null) { for (String propertyName : propMap.keySet()) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(propertyName)); if (elProp != null && elProp.containsMany()) { manyWhereJoin.add(elProp); } } } }
@Override public String nestedPath(BeanDescriptor<?> desc) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(lowProperty)); if (elProp != null && elProp.containsMany()) { // assumes highProperty is also nested property which seems reasonable return SplitName.begin(lowProperty); } return null; }
@Override public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(lowProperty)); if (elProp != null && elProp.containsMany()) { manyWhereJoin.add(elProp); } elProp = desc.getElPropertyDeploy(name(highProperty)); if (elProp != null && elProp.containsMany()) { manyWhereJoin.add(elProp); } }
@Override public String getDeployWord(String expression) { ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression); if (elProp == null) { return null; } else { if (catchFirst && firstProp == null) { firstProp = elProp; } addIncludes(elProp.getElPrefix()); return elProp.getElPlaceholder(encrypted); } }
@Override public boolean isEmbeddedPath(String propertyPath) { ElPropertyDeploy elProp = getElPropertyDeploy(propertyPath); if (elProp == null) { throw new PersistenceException("Invalid path " + propertyPath + " from " + getFullName()); } return elProp.getBeanProperty().isEmbedded(); }
/** * Check the logical property path for containing a 'many' property. */ protected void propertyContainsMany(String propertyName, BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) { if (propertyName != null) { ElPropertyDeploy elProp = desc.getElPropertyDeploy(propertyName); if (elProp != null) { if (elProp.containsFormulaWithJoin()) { // for findCount query select clause manyWhereJoin.addFormulaWithJoin(propertyName); } if (elProp.containsMany()) { // for findCount we join to a many property manyWhereJoin.add(elProp); if (elProp.isAggregation()) { manyWhereJoin.setAggregation(); } } } } }