private boolean isSortable(IPropertyDescriptor propertyDescriptor) { return propertyDescriptor != null && (!propertyDescriptor.isComputed() || propertyDescriptor.getPersistenceFormula() != null); }
private boolean isSortable(IPropertyDescriptor propertyDescriptor) { return propertyDescriptor != null && (!propertyDescriptor.isComputed() || propertyDescriptor.getPersistenceFormula() != null); }
/** * Directly gets all property values out of the property store without any * other operation. * * @param proxy * the proxy to straight get the properties from. * @return The map of properties. */ protected Map<String, Object> straightGetProperties(Object proxy) { Map<String, Object> allProperties = new HashMap<>(); for (IPropertyDescriptor propertyDescriptor : componentDescriptor.getPropertyDescriptors()) { String propertyName = propertyDescriptor.getName(); if (!(propertyDescriptor.isComputed() && propertyDescriptor.getPersistenceFormula() == null)) { allProperties.put(propertyName, straightGetProperty(proxy, propertyName)); } } return allProperties; }
if (propertyDescriptor == null) { for (IPropertyDescriptor pd : baseComponentDescriptor.getPropertyDescriptors()) { if (propertyName.equals(pd.getPersistenceFormula())) { fixedPropertyName = pd.getName();
/** * Directly get a property value out of the property store without any other * operation. * * @param proxy * the proxy to straight get the property from. * @param propertyName * the name of the property. * @return the property value or null. */ protected Object straightGetProperty(Object proxy, String propertyName) { IPropertyDescriptor propertyDescriptor = componentDescriptor.getPropertyDescriptor(propertyName); if (propertyDescriptor == null || (propertyDescriptor.isComputed() && propertyDescriptor.getPersistenceFormula() == null)) { return null; } Object propertyValue = retrievePropertyValue(propertyName); if (propertyValue == null && propertyDescriptor instanceof IBooleanPropertyDescriptor) { return Boolean.FALSE; } return propertyValue; }
IPropertyDescriptor propertyDescriptor = componentDescriptor.getPropertyDescriptor(propertyName); if (propertyDescriptor == null || (propertyDescriptor.isComputed() && propertyDescriptor.getPersistenceFormula() == null)) { return;
/** * Carbon copies all scalar properties. * * @param componentToClone * the source. * @param clonedComponent * the copy. * @param entityFactory * the entity factory to use. */ public static void carbonCopyComponent(IComponent componentToClone, IComponent clonedComponent, IEntityFactory entityFactory) { if (componentToClone == clonedComponent) { return; } IComponentDescriptor<?> componentDescriptor = entityFactory.getComponentDescriptor(componentToClone .getComponentContract()); for (IPropertyDescriptor propertyDescriptor : componentDescriptor.getPropertyDescriptors()) { if (!(propertyDescriptor instanceof IRelationshipEndPropertyDescriptor) && /* propertyDescriptor.isModifiable() */!(propertyDescriptor.isComputed() && propertyDescriptor .getPersistenceFormula() == null)) { String propertyName = propertyDescriptor.getName(); clonedComponent.straightSetProperty(propertyName, ObjectUtils.cloneIfPossible(componentToClone.straightGetProperty(propertyName))); } } } }