private void createTraceRecord( UnitOfWork uow, Class compositeType, Composite object, Method method, Object[] args, long entryTime, long durationNano, Throwable exception )
{
if( object instanceof EntityComposite )
{
EntityComposite entity = (EntityComposite) object;
String identity = entity.identity().get();
EntityComposite source = (EntityComposite) uow.get( (Class<?>) first(
Qi4j.FUNCTION_DESCRIPTOR_FOR.map( entity ).types() ), identity );
EntityBuilder<EntityTraceRecordEntity> builder = uow.newEntityBuilder( EntityTraceRecordEntity.class );
EntityTraceRecordEntity state = builder.instance();
setStandardStuff( compositeType, method, args, entryTime, durationNano, state, exception );
state.source().set( source );