Search in sources :

Example 1 with ReferenceToEntity

use of io.jmix.data.entity.ReferenceToEntity in project jmix by jmix-framework.

the class EntitySnapshotModelConverter method createEntitySnapshot.

public EntitySnapshot createEntitySnapshot(EntitySnapshotModel entitySnapshotModel) {
    if (entitySnapshotModel == null) {
        return null;
    }
    EntitySnapshot entitySnapshot = metadata.create(EntitySnapshot.class);
    ReferenceToEntity referenceToEntity = metadata.create(ReferenceToEntity.class);
    referenceToEntity.setEntityId(entitySnapshotModel.getEntityId());
    referenceToEntity.setIntEntityId(entitySnapshotModel.getIntEntityId());
    referenceToEntity.setLongEntityId(entitySnapshotModel.getLongEntityId());
    referenceToEntity.setStringEntityId(entitySnapshotModel.getStringEntityId());
    entitySnapshot.setEntity(referenceToEntity);
    entitySnapshot.setSnapshotXml(entitySnapshotModel.getSnapshotXml());
    entitySnapshot.setSnapshotDate(entitySnapshotModel.getSnapshotDate());
    entitySnapshot.setCreatedBy(entitySnapshotModel.getCreatedBy());
    entitySnapshot.setCreatedDate(entitySnapshotModel.getCreatedDate());
    entitySnapshot.setSysTenantId(entitySnapshotModel.getSysTenantId());
    entitySnapshot.setFetchPlanXml(entitySnapshotModel.getFetchPlanXml());
    entitySnapshot.setEntityMetaClass(entitySnapshotModel.getEntityMetaClass());
    entitySnapshot.setAuthorUsername(entitySnapshotModel.getAuthorUsername());
    return entitySnapshot;
}
Also used : EntitySnapshot(io.jmix.audit.entity.EntitySnapshot) ReferenceToEntity(io.jmix.data.entity.ReferenceToEntity)

Aggregations

EntitySnapshot (io.jmix.audit.entity.EntitySnapshot)1 ReferenceToEntity (io.jmix.data.entity.ReferenceToEntity)1