Search in sources :

Example 1 with TestEmbeddableEntity

use of com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity in project cuba by cuba-platform.

the class DsContextApplyChangesTest method createEntities.

private void createEntities() {
    master = new TestMasterEntity();
    master.setMasterName("master");
    detail1 = new TestDetailEntity();
    detail1.setDetailName("detail1");
    detail1.setMaster(master);
    detail1.setParts(new HashSet<TestPartEntity>());
    embeddable1 = new TestEmbeddableEntity();
    embeddable1.setName("embeddable1");
    detail1.setEmbeddable(embeddable1);
    master.setDetail(detail1);
}
Also used : TestMasterEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestMasterEntity) TestDetailEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestDetailEntity) TestPartEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestPartEntity) TestEmbeddableEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity)

Example 2 with TestEmbeddableEntity

use of com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity in project cuba by cuba-platform.

the class DsContextTest method createEntities.

private void createEntities() {
    master = new TestMasterEntity();
    master.setMasterName("master");
    master.setDetails(new HashSet<TestDetailEntity>());
    detail1 = new TestDetailEntity();
    detail1.setDetailName("detail1");
    detail1.setMaster(master);
    detail1.setParts(new HashSet<TestPartEntity>());
    embeddable1 = new TestEmbeddableEntity();
    embeddable1.setName("embeddable1");
    detail1.setEmbeddable(embeddable1);
    detail1.setMaster(master);
    part1 = new TestPartEntity();
    part1.setPartName("part1");
    part1.setDetail(detail1);
    detail1.getParts().add(part1);
    master.getDetails().add(detail1);
    detail2 = new TestDetailEntity();
    detail2.setDetailName("detail2");
    detail2.setMaster(master);
    master.getDetails().add(detail2);
}
Also used : TestMasterEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestMasterEntity) TestDetailEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestDetailEntity) TestPartEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestPartEntity) TestEmbeddableEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity)

Example 3 with TestEmbeddableEntity

use of com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity in project cuba by cuba-platform.

the class AttributeAccessSupportTest method getEmbeddableEntitySecurityStateTest.

@Test
public void getEmbeddableEntitySecurityStateTest() {
    EmbeddableEntity entity = new TestEmbeddableEntity();
    SecurityState securityState = BaseEntityInternalAccess.getOrCreateSecurityState(entity);
    BaseEntityInternalAccess.setSecurityState(entity, securityState);
    AttributeAccessSupport attributeAccessSupport = new AttributeAccessSupport();
    Assertions.assertNotNull(attributeAccessSupport.getSecurityState(entity), "com.haulmont.cuba.gui.AttributeAccessSupport#getSecurityState returns null");
}
Also used : TestEmbeddableEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity) EmbeddableEntity(com.haulmont.cuba.core.entity.EmbeddableEntity) TestEmbeddableEntity(com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity) SecurityState(com.haulmont.cuba.core.entity.SecurityState) Test(org.junit.jupiter.api.Test)

Aggregations

TestEmbeddableEntity (com.haulmont.cuba.gui.data.impl.testmodel1.TestEmbeddableEntity)3 TestDetailEntity (com.haulmont.cuba.gui.data.impl.testmodel1.TestDetailEntity)2 TestMasterEntity (com.haulmont.cuba.gui.data.impl.testmodel1.TestMasterEntity)2 TestPartEntity (com.haulmont.cuba.gui.data.impl.testmodel1.TestPartEntity)2 EmbeddableEntity (com.haulmont.cuba.core.entity.EmbeddableEntity)1 SecurityState (com.haulmont.cuba.core.entity.SecurityState)1 Test (org.junit.jupiter.api.Test)1