本文整理了Java中com.haulmont.cuba.core.entity.Entity.setValueEx()
方法的一些代码示例,展示了Entity.setValueEx()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.setValueEx()
方法的具体详情如下:
包路径:com.haulmont.cuba.core.entity.Entity
类名称:Entity
方法名:setValueEx
暂无
代码示例来源:origin: com.haulmont.cuba/cuba-gui
@Override
public void setValue(Object value) {
E item = datasource.getItem();
if (item != null) {
item.setValueEx(metaPropertyPath, value);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-gui
protected void commitBulkChanges() {
List<String> fields = new ArrayList<>();
for (Map.Entry<String, Field> fieldEntry : dataFields.entrySet()) {
Field field = fieldEntry.getValue();
if (isFieldChanged(field)) {
fields.add(managedFields.get(fieldEntry.getKey()).getFqn());
}
}
for (Map.Entry<String, Field> fieldEntry : dataFields.entrySet()) {
Field field = fieldEntry.getValue();
if (!field.isEnabled()) {
for (Entity item : items) {
ensureEmbeddedPropertyCreated(item, fieldEntry.getKey());
item.setValueEx(fieldEntry.getKey(), null);
}
} else if (isFieldChanged(field)) {
for (Entity item : items) {
ensureEmbeddedPropertyCreated(item, fieldEntry.getKey());
item.setValueEx(fieldEntry.getKey(), field.getValue());
}
}
}
Set<Entity> committed = dataSupplier.commit(new CommitContext(items));
Logger logger = LoggerFactory.getLogger(BulkEditorWindow.class);
logger.info("Applied bulk editing for {} entries of {}. Changed properties: {}",
committed.size(), metaClass, StringUtils.join(fields, ", "));
showNotification(formatMessage("bulk.successMessage", committed.size()), NotificationType.HUMANIZED);
close(COMMIT_ACTION_ID);
}
代码示例来源:origin: com.haulmont.cuba/cuba-gui
@Override
public void setValue(V value) {
E item = container.getItemOrNull();
if (item != null) {
if (canUpdateMasterRefs()) {
updateMasterRefs(value);
} else {
item.setValueEx(metaPropertyPath.toPathString(), value);
}
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
protected void handleEditorCommit(Entity editorItem, Entity rowItem, String columnId) {
MetaPropertyPath mpp = rowItem.getMetaClass().getPropertyPath(columnId);
if (mpp == null) {
throw new IllegalStateException(String.format("Unable to find metaproperty %s for class %s",
columnId, rowItem.getMetaClass()));
}
if (mpp.getRange().isClass()) {
DatasourceImplementation ds = ((DatasourceImplementation) table.getDatasource());
boolean modifiedInTable = ds.getItemsToUpdate().contains(rowItem);
boolean ownerDsModified = ds.isModified();
rowItem.setValueEx(columnId, null);
rowItem.setValueEx(columnId, editorItem);
// restore modified for owner datasource
// remove from items to update if it was not modified before setValue
if (!modifiedInTable) {
ds.getItemsToUpdate().remove(rowItem);
}
ds.setModified(ownerDsModified);
} else {
//noinspection unchecked
table.getDatasource().updateItem(editorItem);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-gui
Collection<V> oldValue = itemValue != null ? new ArrayList<>(itemValue) : null;
getItem().setValueEx(metaPropertyPath.toPathString(), value);
内容来源于网络,如有侵权,请联系作者删除!