Search in sources :

Example 11 with MetadataTools

use of com.haulmont.cuba.core.global.MetadataTools in project cuba by cuba-platform.

the class EntityImportView method addLocalProperties.

public EntityImportView addLocalProperties() {
    Metadata metadata = AppBeans.get(Metadata.class);
    MetaClass metaClass = metadata.getClassNN(entityClass);
    MetadataTools metadataTools = metadata.getTools();
    metaClass.getProperties().stream().filter(property -> !property.getRange().isClass() && !metadataTools.isSystem(property)).forEach(metaProperty -> addLocalProperty(metaProperty.getName()));
    return this;
}
Also used : MetadataTools(com.haulmont.cuba.core.global.MetadataTools) Collection(java.util.Collection) Map(java.util.Map) HashMap(java.util.HashMap) AppBeans(com.haulmont.cuba.core.global.AppBeans) MetaClass(com.haulmont.chile.core.model.MetaClass) Entity(com.haulmont.cuba.core.entity.Entity) Metadata(com.haulmont.cuba.core.global.Metadata) Serializable(java.io.Serializable) MetadataTools(com.haulmont.cuba.core.global.MetadataTools) MetaClass(com.haulmont.chile.core.model.MetaClass) Metadata(com.haulmont.cuba.core.global.Metadata)

Aggregations

MetadataTools (com.haulmont.cuba.core.global.MetadataTools)11 MetaClass (com.haulmont.chile.core.model.MetaClass)9 MetaPropertyPath (com.haulmont.chile.core.model.MetaPropertyPath)3 Test (org.junit.Test)3 KeyValueEntity (com.haulmont.cuba.core.entity.KeyValueEntity)2 AppBeans (com.haulmont.cuba.core.global.AppBeans)2 BeanValidation (com.haulmont.cuba.core.global.BeanValidation)2 Metadata (com.haulmont.cuba.core.global.Metadata)2 Op (com.haulmont.cuba.core.global.filter.Op)2 OpManager (com.haulmont.cuba.core.global.filter.OpManager)2 BeanValidator (com.haulmont.cuba.gui.components.validators.BeanValidator)2 TestNotPersistentEntity (com.haulmont.cuba.testmodel.TestNotPersistentEntity)2 Collection (java.util.Collection)2 BeanDescriptor (javax.validation.metadata.BeanDescriptor)2 Joiner (com.google.common.base.Joiner)1 Datatype (com.haulmont.chile.core.datatypes.Datatype)1 MetaProperty (com.haulmont.chile.core.model.MetaProperty)1 CategoryAttribute (com.haulmont.cuba.core.entity.CategoryAttribute)1 Entity (com.haulmont.cuba.core.entity.Entity)1 Folder (com.haulmont.cuba.core.entity.Folder)1