| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <title>JoinTable</title> |
| <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="JoinTable"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../javax/persistence/JoinColumns.html" title="annotation in javax.persistence"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../javax/persistence/Lob.html" title="annotation in javax.persistence"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?javax/persistence/JoinTable.html" target="_top">Frames</a></li> |
| <li><a href="JoinTable.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Field | </li> |
| <li>Required | </li> |
| <li><a href="#annotation.type.optional.element.summary">Optional</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#annotation.type.element.detail">Element</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">javax.persistence</div> |
| <h2 title="Annotation Type JoinTable" class="title">Annotation Type JoinTable</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>@Target(value={METHOD,FIELD}) |
| @Retention(value=RUNTIME) |
| public @interface <span class="memberNameLabel">JoinTable</span></pre> |
| <div class="block">Specifies the mapping of associations. It is applied to the |
| owning side of an association. |
| |
| <p> A join table is typically used in the mapping of many-to-many |
| and unidirectional one-to-many associations. It may also be used to |
| map bidirectional many-to-one/one-to-many associations, |
| unidirectional many-to-one relationships, and one-to-one |
| associations (both bidirectional and unidirectional). |
| |
| <p>When a join table is used in mapping a relationship with an |
| embeddable class on the owning side of the relationship, the |
| containing entity rather than the embeddable class is considered the |
| owner of the relationship. |
| |
| <p> If the <code>JoinTable</code> annotation is missing, the |
| default values of the annotation elements apply. |
| The name of the join table is assumed to be the table names of the |
| associated primary tables concatenated together (owning side |
| first) using an underscore. |
| |
| <pre> |
| |
| Example: |
| |
| @JoinTable( |
| name="CUST_PHONE", |
| joinColumns= |
| @JoinColumn(name="CUST_ID", referencedColumnName="ID"), |
| inverseJoinColumns= |
| @JoinColumn(name="PHONE_ID", referencedColumnName="ID") |
| ) |
| </pre></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>Java Persistence 1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence"><code>JoinColumn</code></a>, |
| <a href="../../javax/persistence/JoinColumns.html" title="annotation in javax.persistence"><code>JoinColumns</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="annotation.type.optional.element.summary"> |
| <!-- --> |
| </a> |
| <h3>Optional Element Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation"> |
| <caption><span>Optional Elements</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Optional Element and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#catalog--">catalog</a></span></code> |
| <div class="block">(Optional) The catalog of the table.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../javax/persistence/ForeignKey.html" title="annotation in javax.persistence">ForeignKey</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#foreignKey--">foreignKey</a></span></code> |
| <div class="block">(Optional) Used to specify or control the generation of a |
| foreign key constraint for the columns corresponding to the |
| <code>joinColumns</code> element when table generation is in |
| effect.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../javax/persistence/Index.html" title="annotation in javax.persistence">Index</a>[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#indexes--">indexes</a></span></code> |
| <div class="block">(Optional) Indexes for the table.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../javax/persistence/ForeignKey.html" title="annotation in javax.persistence">ForeignKey</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#inverseForeignKey--">inverseForeignKey</a></span></code> |
| <div class="block">(Optional) Used to specify or control the generation of a |
| foreign key constraint for the columns corresponding to the |
| <code>inverseJoinColumns</code> element when table generation |
| is in effect.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence">JoinColumn</a>[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#inverseJoinColumns--">inverseJoinColumns</a></span></code> |
| <div class="block">(Optional) The foreign key columns |
| of the join table which reference the |
| primary table of the entity that does |
| not own the association.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence">JoinColumn</a>[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#joinColumns--">joinColumns</a></span></code> |
| <div class="block">(Optional) The foreign key columns |
| of the join table which reference the |
| primary table of the entity owning the |
| association.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#name--">name</a></span></code> |
| <div class="block">(Optional) The name of the join table.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#schema--">schema</a></span></code> |
| <div class="block">(Optional) The schema of the table.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../javax/persistence/UniqueConstraint.html" title="annotation in javax.persistence">UniqueConstraint</a>[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/JoinTable.html#uniqueConstraints--">uniqueConstraints</a></span></code> |
| <div class="block">(Optional) Unique constraints that are |
| to be placed on the table.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="annotation.type.element.detail"> |
| <!-- --> |
| </a> |
| <h3>Element Detail</h3> |
| <a name="name--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>name</h4> |
| <pre>public abstract java.lang.String name</pre> |
| <div class="block">(Optional) The name of the join table. |
| |
| <p> Defaults to the concatenated names of |
| the two associated primary entity tables, |
| separated by an underscore.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="catalog--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>catalog</h4> |
| <pre>public abstract java.lang.String catalog</pre> |
| <div class="block">(Optional) The catalog of the table. |
| <p> Defaults to the default catalog.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="schema--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>schema</h4> |
| <pre>public abstract java.lang.String schema</pre> |
| <div class="block">(Optional) The schema of the table. |
| <p> Defaults to the default schema for user.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="joinColumns--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>joinColumns</h4> |
| <pre>public abstract <a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence">JoinColumn</a>[] joinColumns</pre> |
| <div class="block">(Optional) The foreign key columns |
| of the join table which reference the |
| primary table of the entity owning the |
| association. (I.e. the owning side of |
| the association). |
| |
| <p> Uses the same defaults as for <a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence"><code>JoinColumn</code></a>.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>{}</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="inverseJoinColumns--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>inverseJoinColumns</h4> |
| <pre>public abstract <a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence">JoinColumn</a>[] inverseJoinColumns</pre> |
| <div class="block">(Optional) The foreign key columns |
| of the join table which reference the |
| primary table of the entity that does |
| not own the association. (I.e. the |
| inverse side of the association). |
| |
| <p> Uses the same defaults as for <a href="../../javax/persistence/JoinColumn.html" title="annotation in javax.persistence"><code>JoinColumn</code></a>.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>{}</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="foreignKey--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>foreignKey</h4> |
| <pre>public abstract <a href="../../javax/persistence/ForeignKey.html" title="annotation in javax.persistence">ForeignKey</a> foreignKey</pre> |
| <div class="block">(Optional) Used to specify or control the generation of a |
| foreign key constraint for the columns corresponding to the |
| <code>joinColumns</code> element when table generation is in |
| effect. If both this element and the <code>foreignKey</code> |
| element of any of the <code>joinColumns</code> elements are |
| specified, the behavior is undefined. If no foreign key |
| annotation element is specified in either location, the |
| persistence provider's default foreign key strategy will |
| apply.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>Java Persistence 2.1</dd> |
| </dl> |
| <dl> |
| <dt>Default:</dt> |
| <dd>@javax.persistence.ForeignKey(javax.persistence.ConstraintMode.PROVIDER_DEFAULT)</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="inverseForeignKey--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>inverseForeignKey</h4> |
| <pre>public abstract <a href="../../javax/persistence/ForeignKey.html" title="annotation in javax.persistence">ForeignKey</a> inverseForeignKey</pre> |
| <div class="block">(Optional) Used to specify or control the generation of a |
| foreign key constraint for the columns corresponding to the |
| <code>inverseJoinColumns</code> element when table generation |
| is in effect. If both this element and the |
| <code>foreignKey</code> element of any of the |
| <code>inverseJoinColumns</code> elements are specified, the |
| behavior is undefined. If no foreign key annotation element |
| is specified in either location, the persistence provider's |
| default foreign key strategy will apply.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>Java Persistence 2.1</dd> |
| </dl> |
| <dl> |
| <dt>Default:</dt> |
| <dd>@javax.persistence.ForeignKey(javax.persistence.ConstraintMode.PROVIDER_DEFAULT)</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="uniqueConstraints--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>uniqueConstraints</h4> |
| <pre>public abstract <a href="../../javax/persistence/UniqueConstraint.html" title="annotation in javax.persistence">UniqueConstraint</a>[] uniqueConstraints</pre> |
| <div class="block">(Optional) Unique constraints that are |
| to be placed on the table. These are |
| only used if table generation is in effect. |
| <p> Defaults to no additional constraints.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>{}</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="indexes--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>indexes</h4> |
| <pre>public abstract <a href="../../javax/persistence/Index.html" title="annotation in javax.persistence">Index</a>[] indexes</pre> |
| <div class="block">(Optional) Indexes for the table. These are only used if |
| table generation is in effect.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>Java Persistence 2.1</dd> |
| </dl> |
| <dl> |
| <dt>Default:</dt> |
| <dd>{}</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../javax/persistence/JoinColumns.html" title="annotation in javax.persistence"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../javax/persistence/Lob.html" title="annotation in javax.persistence"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?javax/persistence/JoinTable.html" target="_top">Frames</a></li> |
| <li><a href="JoinTable.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Field | </li> |
| <li>Required | </li> |
| <li><a href="#annotation.type.optional.element.summary">Optional</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#annotation.type.element.detail">Element</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |