org.hibernate.annotations
Annotation Type Table


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Table

Complementary information to a table either primary or secondary


Required Element Summary
 String appliesTo
          name of the targeted table
 
Optional Element Summary
 String comment
          define a table comment
 FetchMode fetch
          If set to JOIN, the default, Hibernate will use an inner join to retrieve a secondary table defined by a class or its superclasses and an outer join for a secondary table defined by a subclass.
 ForeignKey foreignKey
          Defines the Foreign Key name of a secondary table pointing back to the primary table
 Index[] indexes
          Indexes
 boolean inverse
          If true, Hibernate will not try to insert or update the properties defined by this join.
 boolean optional
          If enabled, Hibernate will insert a row only if the properties defined by this join are non-null and will always use an outer join to retrieve the properties.
 SQLDelete sqlDelete
          Defines a custom SQL delete statement Only applies to secondary tables
 SQLInsert sqlInsert
          Defines a custom SQL insert statement Only applies to secondary tables
 SQLUpdate sqlUpdate
          Defines a custom SQL update statement Only applies to secondary tables
 

Element Detail

appliesTo

public abstract String appliesTo
name of the targeted table

indexes

public abstract Index[] indexes
Indexes

Default:
{}

comment

public abstract String comment
define a table comment

Default:
""

foreignKey

public abstract ForeignKey foreignKey
Defines the Foreign Key name of a secondary table pointing back to the primary table

Default:
@org.hibernate.annotations.ForeignKey(name="")

fetch

public abstract FetchMode fetch
If set to JOIN, the default, Hibernate will use an inner join to retrieve a secondary table defined by a class or its superclasses and an outer join for a secondary table defined by a subclass. If set to select then Hibernate will use a sequential select for a secondary table defined on a subclass, which will be issued only if a row turns out to represent an instance of the subclass. Inner joins will still be used to retrieve a secondary defined by the class and its superclasses. Only applies to secondary tables

Default:
org.hibernate.annotations.FetchMode.JOIN

inverse

public abstract boolean inverse
If true, Hibernate will not try to insert or update the properties defined by this join. Only applies to secondary tables

Default:
false

optional

public abstract boolean optional
If enabled, Hibernate will insert a row only if the properties defined by this join are non-null and will always use an outer join to retrieve the properties. Only applies to secondary tables

Default:
true

sqlInsert

public abstract SQLInsert sqlInsert
Defines a custom SQL insert statement Only applies to secondary tables

Default:
@org.hibernate.annotations.SQLInsert(sql="")

sqlUpdate

public abstract SQLUpdate sqlUpdate
Defines a custom SQL update statement Only applies to secondary tables

Default:
@org.hibernate.annotations.SQLUpdate(sql="")

sqlDelete

public abstract SQLDelete sqlDelete
Defines a custom SQL delete statement Only applies to secondary tables

Default:
@org.hibernate.annotations.SQLDelete(sql="")


Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.