-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Generating JavaDoc from DB comments Postgree
PostPosted: Sun Apr 06, 2008 4:21 am 
Newbie

Joined: Sun Apr 06, 2008 4:08 am
Posts: 1
Location: Dublin, Ireland
Hi,
I am using Hibernate Tools to generating code from existing database. It was already very customized by modifications of HB Tools sources. However I have a problem how to get description of table and fields that I have in database (I want to insert it in javadoc). I just want to know if HB tools reads it and where it is stored. When trying column.getComment() - got null.
Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 06, 2008 7:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well we do read it.....and then put it in that comment field IFF the jdbc driver/metadatadialect returns it.

p.s. why did you have to change things in tools to adopt for your things ? couldn't you just extend the templates or ? Just asking to know which obstacles made you require changing things instead of extending.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: But how to get the comment of table and field?
PostPosted: Mon Apr 07, 2008 11:38 pm 
Newbie

Joined: Thu May 11, 2006 10:20 pm
Posts: 5
i try to get the comment by using pojo.getTable().getCommen(),but unsuccessful in the template,

and by the hibernate tools,i can generate SerialVersionUID for the model?


Top
 Profile  
 
 Post subject: Re: But how to get the comment of table and field?
PostPosted: Tue Apr 08, 2008 1:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
chlol wrote:
i try to get the comment by using pojo.getTable().getCommen(),but unsuccessful in the template,


I assume you mean pojo.getTable().getComment() ?

If it is not there then the jdbc driver or metadatadialect did not pick it up.

Quote:
and by the hibernate tools,i can generate SerialVersionUID for the model?


We do not generate serialVersionUID because it is not something you should do lightly.

See http://opensource.atlassian.com/project ... se/HBX-964 for the discussion, i'll paste my previous replies for this:

"So why do I not go and add serialVersionUID to the generated entities ?

A) by implementing Serializable you just indicate that this object should be able to serialize to a stream, nothing more - nothing less!

B) by adding a serialVersionUID you are indicating much more, namely that this class is serializable *across* different versions of it - and note what eclipse generates is as far as I know exactly the same thing that the vm would do anyway, and hence why have that extra line ?

C) serialVersionUID=1 is *wrong* since the same class can change over time and the id won't be the same.

So what are the options:

Either we generate the full serialversionUID based on class signature but that implies B and that is just not true.
Or we remove the implements serializable, but what does that statement do besides making eclipse's bogus warnings light up and making all entities non-serializable by default ?

Feel very free to convince me of why eclipse's warning is correct and we should all add serialVersionUID even though I'm quite sure very few percent of those people adding the versionuid's doesn't actually do that."

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.