<div>Hi all,</div>
<div> </div>
<div>Today I made the relevant code changes in AnnotationBinder.java, EJB3Column.java and table.ftl. Its worked like dream.Just I couldn't believe myself.</div>
<div> </div>
<div>Please take diff from the existing file and let me know your comments. Sorry I could not send the diff.</div>
<div> </div>
<div>Changes made:</div>
<div> </div>
<div>Classs Name: EJB3Column.java</div>
<div> </div>
<div>Methods: <font size="2">initMappingColumn,<font size="2">buildColumnFromAnnotation (with additional parameter <font size="2">
<p>String columncomment).</p>
<p>Class Name: AnnotationBinder.java</p>
<p>Methods: <font size="2">processElementAnnotations</font></p></font>
<p></p></font></font>Regards,</div>
<div>Prasanna<br><br> </div>
<div><span class="gmail_quote">On 1/29/08, <b class="gmail_sendername">Prasanna Kothandaraman</b> <<a href="mailto:prkothan@gmail.com">prkothan@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi all,</div>
<div> </div>
<div>Got the breakthru in problem I narrated in my earlier mail. Its because of my ignorance ;-).</div>
<div> </div>
<div>Column annotations are controlled via "<font size="2">XProperty property". Soon I should start thinking about presentation layer modifications.</font></div>
<div><font size="2"></font> </div>
<div><font size="2">Please let me know if you have any inputs.</font></div>
<div> </div>
<div>Regards,</div><span class="sg">
<div>Prasanna<br><br> </div></span>
<div><span class="e" id="q_117c3b6774e84a5b_2">
<div><span class="gmail_quote">On 1/29/08, <b class="gmail_sendername">Prasanna Kothandaraman</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:prkothan@gmail.com" target="_blank">prkothan@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi all,</div>
<div> </div>
<div>I have done the following</div>
<div> </div>
<div>1. Created org.hibernate.annotations.Column.java </div>
<div> (Well, I know its very minor task ;-) )</div>
<div> </div>
<div> </div>
<div>2. Understood code flow from </div>
<div> </div>
<div>AnnotationConfiguration --> AnnotationBinder (bindClass and EJB3Column.buildColumnFromAnnotation)--> EntityBinder(processComplementaryTableDefinitions).</div>
<div> </div>
<div>3. Specifically I understood how org.hibernate.annotations.Table (comment) works</div>
<div> </div>
<div> </div>
<div>Hence I tried to add column comment in similar fashion. The first hurdle I am facing is, the ColumnAnnotation class is not available at bindClass().</div>
<div> </div>
<div> </div>
<div>Here the code:</div>
<div> </div>
<div>AnnotationBinder.java {</div>
<div> </div>
<div>---</div>
<div>bindClass(..) {</div>
<div> </div>
<div>----</div>
<div>---</div>
<div><font color="#3f7f5f" size="2">
<p align="left">//add process complementary Table definition (index & all)</p></font><font size="2">
<p align="left">entityBinder.processComplementaryTableDefinitions( annotatedClass.getAnnotation( org.hibernate.annotations.</p></font><font color="#646464" size="2">Table</font><font size="2">.</font><b><font color="#7f0055" size="2">class</font></b><font size="2"> ) );
<p align="left"></p>
<p align="left"></p>
<p align="left"></p></font><font color="#3f7f5f" size="2">//Prasanna</font><font size="2">
<p align="left">org.hibernate.annotations.</p></font><font color="#646464" size="2">Table</font><font size="2"> tablecomment = annotatedClass.getAnnotation( org.hibernate.annotations.</font><font color="#646464" size="2">Table</font><font size="2">.</font><b><font color="#7f0055" size="2">class</font></b><font size="2"> ) ;
<p align="left"></p></font><b><font color="#7f0055" size="2">if</font></b><font size="2">(</font><b><font color="#7f0055" size="2">null</font></b><font size="2"> == tablecomment)
<p align="left">System.</p></font><i><font color="#0000c0" size="2">out</font></i><font size="2">.println(</font><font color="#2a00ff" size="2">"Table annotation class not available"</font><font size="2">);
<p align="left"></p></font><b><font color="#7f0055" size="2">else</font></b><font size="2"> </font><b><font color="#7f0055" size="2">if</font></b><font size="2">(</font><b><font color="#7f0055" size="2">null</font></b><font size="2">!=tablecomment && </font><b><font color="#7f0055" size="2">null</font></b><font size="2">!=tablecomment.comment())
<p align="left">System.</p></font><i><font color="#0000c0" size="2">out</font></i><font size="2">.println(</font><font color="#2a00ff" size="2">" tablecomment :"</font><font size="2">+tablecomment.comment());
<p align="left"></p></font><b><font color="#7f0055" size="2">else</font></b><font size="2">
<p align="left">System.</p></font><i><font color="#0000c0" size="2">out</font></i><font size="2">.println(</font><font color="#2a00ff" size="2">" tablecomment not available"</font><font size="2">);
<p align="left"></p>
<p align="left"></p>
<p align="left"></p>
<p align="left">org.hibernate.annotations.</p></font><font color="#646464" size="2">Column</font><font size="2"> columncomment = annotatedClass.getAnnotation( org.hibernate.annotations.</font><font color="#646464" size="2">Column</font><font size="2">.</font><b><font color="#7f0055" size="2">class</font></b><font size="2"> ) ;
<p align="left"></p></font><b><font color="#7f0055" size="2">if</font></b><font size="2">(</font><b><font color="#7f0055" size="2">null</font></b><font size="2"> == columncomment)
<p align="left">System.</p></font><i><font color="#0000c0" size="2">out</font></i><font size="2">.println(</font><font color="#2a00ff" size="2">" Column Annotation class not available"</font><font size="2">);
<p align="left"></p></font><b><font color="#7f0055" size="2">else</font></b><font size="2"> </font><b><font color="#7f0055" size="2">if</font></b><font size="2">(</font><b><font color="#7f0055" size="2">null</font></b><font size="2"> != columncomment && </font><b><font color="#7f0055" size="2">null</font></b><font size="2">!=columncomment.comment())
<p align="left">System.</p></font><i><font color="#0000c0" size="2">out</font></i><font size="2">.println(</font><font color="#2a00ff" size="2">" columncomment :"</font><font size="2">+columncomment.comment());
<p align="left"></p></font><b><font color="#7f0055" size="2">else</font></b><font size="2">
<p align="left">System.</p></font><i><font color="#0000c0" size="2">out</font></i><font size="2">.println(</font><font color="#2a00ff" size="2">" column comment not available"</font><font size="2">);
<p align="left"></p>
<p align="left"></p></font><font size="2">
<p align="left">entityBinder.processComplementaryTableDefinitions( annotatedClass.getAnnotation( org.hibernate.annotations.</p></font><font color="#646464" size="2">Tables</font><font size="2">.</font><b><font color="#7f0055" size="2">class</font></b><font size="2"> ) );</font></div>
<div>}</div>
<div> </div>
<div> </div>
<div> </div>
<div>}</div>
<div> </div>
<div> </div>
<div> </div>
<div>Here I always get "<font color="#2a00ff" size="2">Column Annotation class not available". But not so in case in table annotation. It perfectly works.</font></div>
<div><font color="#2a00ff" size="2"></font> </div>
<div><font color="#2a00ff" size="2">I tried adding Column Annotation class using AnnotationConfiguration --> <font size="2">addAnnotatedClass(..). But it didn't worked.</font></font></div>
<div><font color="#2a00ff" size="2"></font> </div>
<div><font color="#2a00ff" size="2">Please see the attachment for the relevant files.</font></div>
<div>Regards,</div><span>
<div>Prasanna</div></span>
<div><span>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 1/28/08, <b class="gmail_sendername">Emmanuel Bernard</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">While not strictly useful for the comment feature, I want to add a<br>@ColumnOrFormula annotation to be able to support mixing formula and<br>
columns in a user type (and a FK definition). Let's say it's a<br>lightly correlated feature.<br><br>On Jan 27, 2008, at 19:17, Oliver B. Fischer wrote:<br><br>> Hello,<br>><br>> I am also still interessted in contributing to this enhancement, but<br>
> didn't find enough time until now.<br>><br>> Emmanuel, in your comment on ANN-537, you suggested an<br>> @ColumnOrFormula annotation. Could you explain your idea a little bit<br>> more?<br>><br>> Prasanna, may we can share the work on this?<br>
><br>> Bye,<br>><br>> Oliver<br>><br>> Prasanna Kothandaraman schrieb:<br>>> Hi,<br>>> I am looking for annotation to add column comments specifically<br>>> for documentation (hbm2doc). I understand that there is no support<br>
>> for this currently.<br>>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://opensource.atlassian.com/projects/hibernate/browse/ANN-537" target="_blank">http://opensource.atlassian.com/projects/hibernate/browse/ANN-537</a><br>
>> I am interested in contributing towards this.<br>>> I had hard look at the source code (especially<br>>> AnnotationBinder.java, EJB3Column.java etc, table.ftl,<br>>> DocExporter.java), but still I could not figure how to provide<br>
>> this support.<br>>> Please let me know how many days it will take.<br>>> I have more than 8 years of Java development experience, and I<br>>> can pickup things quickly. Please guide me.<br>>> Thanks & Regards,<br>
>> Prasanna<br>>><br>>> ---------------------------------------------------------------------<br>>> ---<br>>> _______________________________________________<br>>> hibernate-dev mailing list<br>
>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:hibernate-dev@lists.jboss.org" target="_blank">hibernate-dev@lists.jboss.org</a><br>>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/hibernate-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/hibernate-dev</a><br>
><br>> --<br>> Oliver B. Fischer Tel. +49 (0)30 44 79 32 51<br>> Schönhauser Allee 64 Mobil: +49 (0)178 7903538<br>> D-10437 Berlin mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:o.b.fischer@gmx.de" target="_blank">o.b.fischer@gmx.de</a><br>
><br>> _______________________________________________<br>> hibernate-dev mailing list<br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:hibernate-dev@lists.jboss.org" target="_blank">hibernate-dev@lists.jboss.org</a><br>
> <a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/hibernate-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/hibernate-dev</a><br><br></blockquote></div>
<br></span></div><br clear="all"></blockquote></div><br></span></div></blockquote></div><br>