<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Dmitry Geraskov wrote:
<blockquote cite="mid:4A810F52.50503@exadel.com" type="cite">
  <pre wrap="">Emmanuel Bernard wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">On 10 ao&ucirc;t 09, at 11:31, Max Rydahl Andersen wrote:

    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">It's a clusterfuck, sorry about that. We are all wrong except 
Max-the-manager. Oh the irony ;)
          </pre>
        </blockquote>
      </blockquote>
      <pre wrap="">heey! :)
      </pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">logicalColumnName is the name by which a column should be referred 
in metadata descriptors (like unique constraints, indexes etc). I 
don't think a user needs to use the logical mapping in HBM files 
(the metadata structure don't require it contrary to annotations).
Anyway, the logical name should never appear in a physical column 
name, so HbmBinder #fail.
          </pre>
        </blockquote>
      </blockquote>
    </blockquote>
  </blockquote>
</blockquote>
Javadoc in NamingStrategy proves that Emmanuel is right:<br>
&nbsp;&nbsp;&nbsp; /**<br>
&nbsp;&nbsp;&nbsp; &nbsp;* Alter the column name given in the mapping document<br>
&nbsp;&nbsp;&nbsp; &nbsp;* @param columnName a column name<br>
&nbsp;&nbsp;&nbsp; &nbsp;* @return a column name<br>
&nbsp;&nbsp;&nbsp; &nbsp;*/<br>
&nbsp;&nbsp;&nbsp; public String columnName(String columnName);<br>
<blockquote cite="mid:4A810F52.50503@exadel.com" type="cite">
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap=""><a class="moz-txt-link-freetext" href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-4077">http://opensource.atlassian.com/projects/hibernate/browse/HHH-4077</a>

I've attached a patch and applied it to trunk. It probably needs a 
quick test on your side and can be retrofitted to older versions.
          </pre>
        </blockquote>
      </blockquote>
      <pre wrap="">Doesn't this change the behavior radically ? ...and how should our 
validator know which sequence of calls it should use ...i hate bugs ;0)
      </pre>
    </blockquote>
    <pre wrap="">No it does not because realistically, doing an implementation 
of logicalColumnName like the one in this test has no usecase.
What does the validator do exactly? I'm not clear how it should use 
the NS.
    </pre>
  </blockquote>
  <pre wrap=""><!---->The Dali's validator checks that the table/column you are references 
exists. When user uses NamingStrategy the name of the table/column are 
different from default one, so we need to change this check according to 
the NamingStrategy altering. To do this we need to know exactly how 
Hibernete will do the conwersion of default/specified name to db-object 
name.
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">Looking in fisheye this change were done almost 4 years ago... 
<a class="moz-txt-link-freetext" href="http://fisheye.jboss.org/changelog/Hibernate?cs=8918">http://fisheye.jboss.org/changelog/Hibernate?cs=8918</a>
for <a class="moz-txt-link-freetext" href="http://opensource.atlassian.com/projects/hibernate/browse/ANN-176">http://opensource.atlassian.com/projects/hibernate/browse/ANN-176</a> 
where it seems to be done very deliberately ?

are you sure this is a proper change ?
      </pre>
    </blockquote>
    <pre wrap="">Of course, I always do things deliberately but then I dont' remember. 
In this case, I did fix the user bug by adding the 
mapping.addColumnBinding() calls. I think back in the days, I thought 
the logicalColumn should also be passed toNS.columnName. I think it is 
wrong today.
In practice, MC.logicalColumn is almost always idempotent if the 
column name is not null. That's why we have never seen any impact.

    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">FTR
Hibernate Annotations uses a different naming strategy than core 
for backward compatibility reasons.
JPA defaults are not Hibernate Core defaults
<a class="moz-txt-link-freetext" href="http://anonsvn.jboss.org/repos/hibernate/core/trunk/annotations/src/main/java/org/hibernate/cfg/EJB3NamingStrategy.java">http://anonsvn.jboss.org/repos/hibernate/core/trunk/annotations/src/main/java/org/hibernate/cfg/EJB3NamingStrategy.java</a>
          </pre>
        </blockquote>
      </blockquote>
      <pre wrap="">Yes, but that we will just pick up automatically since it does not 
change the sequence of calls done to the namingstrategy.

Anyway, for now we'll just focus on the JPA behavior since that is 
the most relevant for JPA Project validation at least ;)

/max
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Best regards,

 Dmitry Geraskov              
 <a class="moz-txt-link-abbreviated" href="mailto:dgeraskov@exadel.com">dgeraskov@exadel.com</a>
 Senior Developer
 Exadel Inc
</pre>
</body>
</html>