Search in sources :

Example 1 with EntityDebugRecordEntity

use of org.qi4j.logging.debug.records.EntityDebugRecordEntity in project qi4j-sdk by Qi4j.

the class DebuggingServiceMixin method createDebugRecord.

private void createDebugRecord(UnitOfWork uow, Composite composite, String message, List<Serializable> params) {
    if (composite instanceof ServiceComposite) {
        EntityBuilder<ServiceDebugRecordEntity> builder = uow.newEntityBuilder(ServiceDebugRecordEntity.class);
        ServiceDebugRecordEntity state = builder.instance();
        setStandardStuff(composite, message, state, params);
        state.source().set(((ServiceComposite) composite).identity().get());
        ServiceDebugRecordEntity slr = builder.newInstance();
    } else if (composite instanceof EntityComposite) {
        EntityBuilder<EntityDebugRecordEntity> builder = uow.newEntityBuilder(EntityDebugRecordEntity.class);
        EntityDebugRecordEntity state = builder.instance();
        setStandardStuff(composite, message, state, params);
        state.source().set((EntityComposite) composite);
        EntityDebugRecordEntity elr = builder.newInstance();
    } else {
        EntityBuilder<CompositeDebugRecordEntity> builder = uow.newEntityBuilder(CompositeDebugRecordEntity.class);
        CompositeDebugRecordEntity state = builder.instance();
        setStandardStuff(composite, message, state, params);
        state.source().set(composite);
        CompositeDebugRecordEntity clr = builder.newInstance();
    }
}
Also used : EntityComposite(org.qi4j.api.entity.EntityComposite) EntityBuilder(org.qi4j.api.entity.EntityBuilder) EntityDebugRecordEntity(org.qi4j.logging.debug.records.EntityDebugRecordEntity) ServiceComposite(org.qi4j.api.service.ServiceComposite) ServiceDebugRecordEntity(org.qi4j.logging.debug.records.ServiceDebugRecordEntity) CompositeDebugRecordEntity(org.qi4j.logging.debug.records.CompositeDebugRecordEntity)

Aggregations

EntityBuilder (org.qi4j.api.entity.EntityBuilder)1 EntityComposite (org.qi4j.api.entity.EntityComposite)1 ServiceComposite (org.qi4j.api.service.ServiceComposite)1 CompositeDebugRecordEntity (org.qi4j.logging.debug.records.CompositeDebugRecordEntity)1 EntityDebugRecordEntity (org.qi4j.logging.debug.records.EntityDebugRecordEntity)1 ServiceDebugRecordEntity (org.qi4j.logging.debug.records.ServiceDebugRecordEntity)1