<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>
<div>Prasanna</div>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 1/28/08, <b class="gmail_sendername">Emmanuel Bernard</b> <<a href="mailto:emmanuel@hibernate.org">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 href="http://opensource.atlassian.com/projects/hibernate/browse/ANN-537">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 href="mailto:hibernate-dev@lists.jboss.org">hibernate-dev@lists.jboss.org</a><br>>> <a href="https://lists.jboss.org/mailman/listinfo/hibernate-dev">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 href="mailto:o.b.fischer@gmx.de">o.b.fischer@gmx.de</a><br>
><br>> _______________________________________________<br>> hibernate-dev mailing list<br>> <a href="mailto:hibernate-dev@lists.jboss.org">hibernate-dev@lists.jboss.org</a><br>> <a href="https://lists.jboss.org/mailman/listinfo/hibernate-dev">https://lists.jboss.org/mailman/listinfo/hibernate-dev</a><br>
<br></blockquote></div><br>