@Override public void copyFrom(AbstractSearchFolder srcFolder) { super.copyFrom(srcFolder); setVisibilityScript(((AppFolder) srcFolder).getVisibilityScript()); setQuantityScript(((AppFolder) srcFolder).getQuantityScript()); }
protected void setCategoryEntityType(CategoryAttribute entity) { if (entity.getCategory() != null) { entity.setCategoryEntityType(entity.getCategory().getEntityType()); } } }
@Override public void setId(IdProxy<K> idProxy) { this.idProxy = idProxy.copy(false); setDbGeneratedId(this.idProxy.get()); this.idProxy.setEntity(this); }
/** * @param entity entity * @return entity id to store in database */ public Object getReferenceId(Entity entity) { if (entity instanceof HasUuid) { return ((HasUuid) entity).getUuid(); } Object entityId = entity.getId(); if (entityId instanceof IdProxy) { return ((IdProxy) entityId).get(); } return entity.getId(); }
/** * @param id id of an entity to be loaded * @return this instance for chaining */ public LoadContext<E> setId(Object id) { this.id = id instanceof Entity ? ((Entity) id).getId() : id; // for compatibility with legacy code relying on implicit conversions return this; }
public static String[] getInaccessibleAttributes(Entity entity) { SecurityState state = getSecurityState(entity); return state != null ? getInaccessibleAttributes(state) : null; }
public static byte[] getSecurityToken(Entity entity) { SecurityState state = getSecurityState(entity); return state != null ? getSecurityToken(state) : null; }
protected void updateEntityMetadata(KeyValueEntity entity) { entity.setMetaClass(entityMetaClass); if (idName != null) entity.setIdName(idName); }
public String getLocaleName() { localeName = LocaleHelper.getLocalizedName(localeNames); if (localeName == null) { localeName = name; } return localeName; } }
public void setObjectEntityId(Object entityId) { if (entity != null) { entity.setObjectEntityId(entityId); } }
@Override @SuppressWarnings("unchecked") public <T> T getValue(String name) { return (T) mainItem.getValue(name); }
public String getEnumerationLocale() { enumerationLocale = LocaleHelper.getLocalizedEnumeration(enumeration, enumerationLocales); if (enumerationLocale == null) { enumerationLocale = enumeration; } return enumerationLocale; }
@SuppressWarnings("unchecked") @Override public T getParent(T item) { return (T) item.getParent(); } }
@Override public void setValueEx(BeanPropertyPath propertyPath, Object value) { mainItem.setValueEx(propertyPath, value); } }
/** * Create proxy for the specified ID value. You might need it for providing ID to the {@code EntityManager.find()} * method. * @param value real ID value */ public static <T extends Number> IdProxy<T> of(T value) { return new IdProxy<>(value); }
@Override public void removeAllListeners() { mainItem.removeAllListeners(); }
@Override public Object getItemId(E item) { return item.getId(); }
protected void updateEntityMetadata(KeyValueEntity entity) { entity.setMetaClass(entityMetaClass); if (idName != null) entity.setIdName(idName); } }
public String getLocaleName() { localeName = LocaleHelper.getLocalizedName(localeNames); if (localeName == null) { localeName = name; } return localeName; }