9

I would like Hibernate, when generating DDL, to include comments from my java source. I'd be happy to do this as an annotation, or as a javadoc tag.

IOW: I'd like to be able to go

@Entity
@DDLComment "This entity is cool"
class Foo {
  @DDLComment "But this field is kinda lame"
  int lame_o_rama;

And (in oracle), hibernate should generate

CREATE TABLE FOO ( LAME_O_RAMA number };
COMMENT ON FOO IS 'This entity is cool';
COMMENT ON FOO.LAME_O_RAMA 'But this field is kinda lame';

Is there a annotation, doc tag, config option, etc etc, to do this?

PaulMurrayCbr
  • 1,167
  • 12
  • 16
  • There has been a discussion on this topic, but as it appears nothing happened after that: https://forum.hibernate.org/viewtopic.php?f=9&t=942748 – Mirko Jahn May 23 '13 at 12:18

1 Answers1

0

from hibernate docs ...

SchemaExport is a Hibernate utility which generates DDL from your mapping files. The generated schema includes referential integrity constraints, primary and foreign keys, for entity and collection tables. It also creates tables and sequences for mapped identifier generators.

doc

how ever the schemaexport utility is to help with the development, no for maintenance or production. Hibernate: hbm2ddl.auto=update in production?

Community
  • 1
  • 1
osdamv
  • 3,493
  • 2
  • 21
  • 33