javax.persistence
Annotation Type MapKeyJoinColumn


@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface MapKeyJoinColumn

The MapKeyJoinColumn annotation is used to specify a mapping to an entity that is a map key. The map key join column is in the collection table, join table, or table of the target entity that is used to rep- resent the map.

Since:
JPA 2.0 version.
Author:
Florent Benoit
See Also:
JPA 2.0 specification

Optional Element Summary
 String columnDefinition
          (Optional) The SQL fragment that is used when generating the DDL for the column.
 boolean insertable
          (Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.
 String name
          (Optional) The name of the foreign key column for the map key.
 boolean nullable
          (Optional) Whether the foreign key col- umn is nullable.
 String referencedColumnName
          (Optional) The name of the column ref- erenced by this foreign key column.
 String table
          (Optional) The name of the table that contains the foreign key column.
 boolean unique
          (Optional) Whether the property is a unique key.
 boolean updatable
          (Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.
 

name

public abstract String name
(Optional) The name of the foreign key column for the map key. The table in which it is found depends upon the con- text. If the join is for a map key for an element collection, the foreign key col- umn is in the collection table for the map value. If the join is for a map key for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the foreign key column is in a join table. If the join is for a OneToMany entity relationship using a foreign key mapping strategy, the foreign key col- umn for the map key is in the table of the entity that is the value of the map.

Default:
""

referencedColumnName

public abstract String referencedColumnName
(Optional) The name of the column ref- erenced by this foreign key column. The referenced column is in the table of the target entity.

Default:
""

unique

public abstract boolean unique
(Optional) Whether the property is a unique key. This is a shortcut for the UniqueConstraint annotation at the table level and is useful for when the unique key constraint is only a single field.

Default:
false

nullable

public abstract boolean nullable
(Optional) Whether the foreign key col- umn is nullable.

Default:
false

insertable

public abstract boolean insertable
(Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.

Default:
true

updatable

public abstract boolean updatable
(Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.

Default:
true

columnDefinition

public abstract String columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the column.

Default:
""

table

public abstract String table
(Optional) The name of the table that contains the foreign key column. If the join is for a map key for an element col- lection, the foreign key column is in the collection table for the map value. If the join is for a map key for a ManyToMany entity relationship or for a OneToMany entity relationship using a join table, the foreign key column is in a join table. If the join is for a OneToMany entity rela- tionship using a foreign key mapping strategy, the foreign key column for the map key is in the table of the entity that is the value of the map.

Default:
""


Copyright © 2007-2012 OW2 Consortium. All Rights Reserved.