[ 
http://issues.ops4j.org/browse/QI-274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13713#action_13713
 ] 

Niclas Hedhman commented on QI-274:
-----------------------------------

I think the reason for the difference is purely for performance reasons, i.e. 
avoiding to create a EntityBulder when newEntity() is called.

I am curious to learn of a use-case where it matters whether the life-cycle is 
called with the prototype or the actual final entity state. After all, any 
modifications that the life cycle method does will be applied to the final 
actual state, even for the builder.newInstance().

> Different behaviour in UnitOfWork.newEntity(...) and 
> EntityBuilder.newInstance()
> --------------------------------------------------------------------------------
>
>                 Key: QI-274
>                 URL: http://issues.ops4j.org/browse/QI-274
>             Project: Qi4j
>          Issue Type: Bug
>          Components: Core Runtime
>    Affects Versions: 1.2
>         Environment: Qi4j.
>            Reporter: Stanislav Muhametsin
>            Assignee: Rickard Öberg
>             Fix For: 1.3
>
>         Attachments: creating_entity.zip
>
>
> When creating an entity via UnitOfWork.newEntity() method, it gets 
> initialized in a different way than when creating it via 
> EntityBuilder.newInstance(). If one has Lifecycle-mixin, that mixin gets 
> actual entity state when using UoW method, and gets prototype state when 
> using EntityBuilder.
> If this is not a desired behaviour, then one way of doing things should be 
> chosen and used uniformly throughout the APIs designated for creating an 
> entity.
> If this is a desired behaviour, then it should be clearly documented. 
> Additionally, there must be a way to check via API whether the state is 
> prototype or actual instance.
> Test-case attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to