blob: 3b37d4960f01ab11569945921b357bbe975c517c [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Fri Nov 27 12:46:12 EST 2009 -->
<TITLE>
MapKeyColumn (EclipseLink 2.0.0, build 'v20091127-r5931' API Reference)
</TITLE>
<META NAME="date" CONTENT="2009-11-27">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="MapKeyColumn (EclipseLink 2.0.0, build 'v20091127-r5931' API Reference)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/persistence/MapKeyClass.html" title="annotation in javax.persistence"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../javax/persistence/MapKeyEnumerated.html" title="annotation in javax.persistence"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/persistence/MapKeyColumn.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="MapKeyColumn.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;REQUIRED&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.persistence</FONT>
<BR>
Annotation Type MapKeyColumn</H2>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1">@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
</FONT>public @interface <B>MapKeyColumn</B></DL>
</PRE>
<P>
Specifies the mapping for the key column of a map whose
map key is a basic type. If the <code>name</code> element is not specified, it
defaults to the concatenation of the following: the name of the
referencing relationship field or property; "_"; "KEY".
<pre>
Example:
&#064;Entity
public class Item {
&#064;Id int id;
...
&#064;ElementCollection
&#064;MapKeyColumn(name="IMAGE_NAME")
&#064;Column(name="IMAGE_FILENAME")
&#064;CollectionTable(name="IMAGE_MAPPING")
Map&#060;String, String&#062; images; // map from image name to filename
...
}
</pre>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>Java Persistence 2.0</DD>
</DL>
<HR>
<P>
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<A NAME="annotation_type_optional_element_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Optional Element Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#columnDefinition()">columnDefinition</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) The SQL fragment that is used when generating the DDL for the
column.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#insertable()">insertable</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) Whether the column is included in SQL INSERT statements
generated by the persistence provider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#length()">length</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) The column length.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#name()">name</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) The name of the map key column.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#nullable()">nullable</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) Whether the database column is nullable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#precision()">precision</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) The precision for a decimal (exact numeric) column.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#scale()">scale</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) The scale for a decimal (exact numeric) column.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#table()">table</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) The name of the table that contains the column.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#unique()">unique</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) Whether the column is a unique key.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/persistence/MapKeyColumn.html#updatable()">updatable</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Optional) Whether the column is included in SQL UPDATE statements
generated by the persistence provider.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<A NAME="name()"><!-- --></A><H3>
name</H3>
<PRE>
public abstract java.lang.String <B>name</B></PRE>
<DL>
<DD>(Optional) The name of the map key column. The table in which it is found
depends upon the context. If the map key is for an element collection,
the map key column is in the collection table for the map value. If the
map key is for a ManyToMany entity relationship or for a OneToMany entity
relationship using a join table, the map key column is in a join table.
If the map key is for a OneToMany entity relationship using a foreign key
mapping strategy, the map key column is in the table of the entity that
is the value of the map.
<p> Defaults to the concatenation of the following: the name of
the referencing relationship field or property; "_"; "<code>KEY</code>".
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>""</DD>
</DL>
</DL>
<HR>
<A NAME="unique()"><!-- --></A><H3>
unique</H3>
<PRE>
public abstract boolean <B>unique</B></PRE>
<DL>
<DD>(Optional) Whether the column is a unique key. This is a
shortcut for the <code>UniqueConstraint</code> annotation
at the table level and is useful for when the unique key
constraint corresponds to only a single column. This
constraint applies in addition to any constraint entailed
by primary key mapping and to constraints specified at the
table level.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>false</DD>
</DL>
</DL>
<HR>
<A NAME="nullable()"><!-- --></A><H3>
nullable</H3>
<PRE>
public abstract boolean <B>nullable</B></PRE>
<DL>
<DD>(Optional) Whether the database column is nullable.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>false</DD>
</DL>
</DL>
<HR>
<A NAME="insertable()"><!-- --></A><H3>
insertable</H3>
<PRE>
public abstract boolean <B>insertable</B></PRE>
<DL>
<DD>(Optional) Whether the column is included in SQL INSERT statements
generated by the persistence provider.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>true</DD>
</DL>
</DL>
<HR>
<A NAME="updatable()"><!-- --></A><H3>
updatable</H3>
<PRE>
public abstract boolean <B>updatable</B></PRE>
<DL>
<DD>(Optional) Whether the column is included in SQL UPDATE statements
generated by the persistence provider.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>true</DD>
</DL>
</DL>
<HR>
<A NAME="columnDefinition()"><!-- --></A><H3>
columnDefinition</H3>
<PRE>
public abstract java.lang.String <B>columnDefinition</B></PRE>
<DL>
<DD>(Optional) The SQL fragment that is used when generating the DDL for the
column.
<p> Defaults to the generated SQL to create a
column of the inferred type.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>""</DD>
</DL>
</DL>
<HR>
<A NAME="table()"><!-- --></A><H3>
table</H3>
<PRE>
public abstract java.lang.String <B>table</B></PRE>
<DL>
<DD>(Optional) The name of the table that contains the column.
<p> Defaults: If the map key is for an element collection,
the name of the collection table for the map value. If the
map key is for a OneToMany or ManyToMany entity
relationship using a join table, the name of the join table
for the map. If the map key is for a OneToMany entity
relationship using a foreign key mapping strategy, the name
of the primary table of the entity that is the value of the
map.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>""</DD>
</DL>
</DL>
<HR>
<A NAME="length()"><!-- --></A><H3>
length</H3>
<PRE>
public abstract int <B>length</B></PRE>
<DL>
<DD>(Optional) The column length. (Applies only if a string-valued column is
used.)
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>255</DD>
</DL>
</DL>
<HR>
<A NAME="precision()"><!-- --></A><H3>
precision</H3>
<PRE>
public abstract int <B>precision</B></PRE>
<DL>
<DD>(Optional) The precision for a decimal (exact numeric) column. (Applies
only if a decimal column is used.)
<p> Default: 0. (The value must be set by the developer.)
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>0</DD>
</DL>
</DL>
<HR>
<A NAME="scale()"><!-- --></A><H3>
scale</H3>
<PRE>
public abstract int <B>scale</B></PRE>
<DL>
<DD>(Optional) The scale for a decimal (exact numeric) column. (Applies only
if a decimal column is used.)
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
<DL>
<DT><B>Default:</B><DD>0</DD>
</DL>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/persistence/MapKeyClass.html" title="annotation in javax.persistence"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../javax/persistence/MapKeyEnumerated.html" title="annotation in javax.persistence"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/persistence/MapKeyColumn.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="MapKeyColumn.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;REQUIRED&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>