<div dir="ltr">I&#39;ve created <a href="https://hibernate.onjira.com/browse/BVAL-357" target="_blank">https://hibernate.onjira.com/browse/BVAL-357</a><div><br></div><div>&gt; <span style="font-family:arial,sans-serif;font-size:13px">I think you should call isReachable and isCascadable for params and return values.</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">&gt; </span><span style="font-family:arial,sans-serif;font-size:13px">Of the top of my head I cannot think of a reason why we would need to use isReachable on a parameter</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">So do you think isReachable() *is* required or not? Regarding your entity example, did you mean it like this:</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">@Entity</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">public class Customer {}</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">public class CustomerService {</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">    public void updateCustomer(@RetailCustomer @Valid Customer customer) {</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px">    }</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">}</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Then I guess it would indeed make sense to call isReachable() and isCascadable() when validating the &quot;customer&quot; parameter.</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">--Gunnar</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/10 Emmanuel Bernard <span dir="ltr">&lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That&#39;s an interesting question. I think you should call isReachable and isCascadable for params and return values.<br>


Imagine a constraint validating a JPA entity. You don&#39;t want it to be validated if the entity is a proxy. This constraint could access a few of the entity state properties. And that&#39;s before cascading.<br>
<br>
isCascadable was a contract added specifically so that the same entity would not be validated over and over if it happened to be referenced by several other entities in a dirty persistence context.<br>
<br>
Open an issue because we need to clarify all that in the spec.<br>
<br>
Emmanuel<br>
<br>
Of the top of my head I cannot think of a reason why we would need to use isReachable on a parameter<br>
<div><div><br>
On 9 janv. 2013, at 15:42, Gunnar Morling &lt;<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>&gt; wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; working on the TCK, I&#39;m wondering whether a BV provider should use TraversableResolver#isReachable() and isCascadable()) to check whether a validated method parameter or return value may be accessed/traversed.<br>


&gt;<br>
&gt; I think checking for cascadability might make sense, but I&#39;m not so sure about checking for reachability; can e.g. be a parameter not reachable?<br>
&gt;<br>
&gt; If any of the checks shall be done for method validation, we need to update the TraversableResolver contract (section 4.6.3) which currently explicitly speaks about properties and is limited to the element types FIELD and METHOD.<br>


&gt;<br>
&gt; WDYT?<br>
&gt;<br>
&gt; --Gunnar<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
<br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</blockquote></div><br></div></div>