Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Specifying column/table/index comments in DDL
PostPosted: Sun May 22, 2005 4:06 pm 
Newbie

Joined: Thu Jan 20, 2005 11:01 am
Posts: 15
I'm wondering if anyone knows what annotations to use to specify column, table, index comments such that they may be generated as part of the SQL DDL (I am using Hibernate 3.0 on JDK 1.5). I am using the forward-engineering approach to generate DDL for about 200+ tables but there are no comments being assigned to columns/tables and my DBAs are complaining.

Is this supported in Hibernate 3.0? EJB 3.0?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 22, 2005 6:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Especially for you, I have added a <comment> element to HB3 XML mappings. This will be in 3.0.4 and will work for any db which supports the "comment on ... is ... " syntax. (Unfortunately, this does not include MySQL.)

It would be trivial to add support for this feature to Hibernate Annotations.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 22, 2005 7:17 pm 
Newbie

Joined: Thu Jan 20, 2005 11:01 am
Posts: 15
Gavin, you are too kind :-). We are deeply indebted to you and the other team members for both Hibernate and now this feature.

Hopefully Emmanuel will add the functionality to the annotations package soon as well. Emmanual -- are you game? Pretty please? :-)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 10:58 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7242
Location: Paris, France
To be very honest, I'm not sure it fits well in an annotation. Imagine a 10 lines comment on top of your java class, hum...

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 11:07 am 
Newbie

Joined: Thu Jan 20, 2005 11:01 am
Posts: 15
Emmanuel, I would love to get the annotations to allow setting the comment because right now I have about 200 tables fully defined through annotations and would hate to move to XML just for comments (which are very important). While it may seem ugly, it would be very useful to have table/column comments in the annotations. We are using forward-engineering table generation (DDL is generated by hibernate and a small script does minor modifications afterwards).

Would you mind going ahead and providing the support via annotations? For us, the only other thing we're waiting for within annotations is UUID generation support (bug is already present).

Your annotations support rocks! Keep up the great work.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 11:58 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7242
Location: Paris, France
Try and provide a patch. I'll accept it. This shouldn't be too hard.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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 2015, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.