Top Description Methods
org.hibernate.annotations

public @Interface Comment

extends Annotation
Annotations
@TypeBinderType
binder:CommentBinder
@AttributeBinderType
binder:CommentBinder
@Target:METHOD, FIELD, TYPE
@Retention:RUNTIME
@Repeatable:Comments
@Remove
Imports
org.hibernate.Remove, org.hibernate.binder.internal.CommentBinder, java.lang.annotation.Repeatable, .Retention, .Target

Specifies a comment that will be included in generated DDL.

By default, if on is not specified:

But when on is explicitly specified, the comment applies to the mapped table or column with the specified name.

For example:

@Entity
@Table(name = "book")
@SecondaryTable(name = "edition")
@Comment("The primary table for Book")
@Comment(on = "edition",
         value = "The secondary table for Book")
class Book { ... }

API Note

In principle, it's possible for a column of a secondary table to have the same name as a column of the primary table, or as a column of some other secondary table. Therefore, on may be ambiguous.

Authors
Yanming Zhou, Gavin King

Method Summary

Modifier and TypeMethod and Description
public String
on()

The name of the table or column to add the comment to.

public String
value()

The text of the comment.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

onback to summary
public String on()

The name of the table or column to add the comment to.

valueback to summary
public String value()

The text of the comment.