This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/*******************************************************************************
|
/** *****************************************************************************
|
||||||
* Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
|
* Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials are made available under the
|
* This program and the accompanying materials are made available under the
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
* Contributors:
|
* Contributors:
|
||||||
* Linda DeMichiel - Java Persistence 2.1
|
* Linda DeMichiel - Java Persistence 2.1
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
***************************************************************************** */
|
||||||
package javax.persistence;
|
package javax.persistence;
|
||||||
|
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
@@ -24,23 +24,18 @@ import java.lang.annotation.Target;
|
|||||||
* Note that it is not necessary to specify an index for a primary key,
|
* Note that it is not necessary to specify an index for a primary key,
|
||||||
* as the primary key index will be created automatically.
|
* as the primary key index will be created automatically.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* The syntax of the <code>columnList</code> element is a
|
* The syntax of the <code>columnList</code> element is a
|
||||||
* <code>column_list</code>, as follows:
|
* <code>column_list</code>, as follows:
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* column::= index_column [,index_column]*
|
* column::= index_column [,index_column]*
|
||||||
* index_column::= column_name [ASC | DESC]
|
* index_column::= column_name [ASC | DESC]
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
* <p> If <code>ASC</code> or <code>DESC</code> is not specified,
|
|
||||||
* <code>ASC</code> (ascending order) is assumed.
|
|
||||||
*
|
*
|
||||||
* @see Table
|
* <p>
|
||||||
* @see SecondaryTable
|
* If <code>ASC</code> or <code>DESC</code> is not specified,
|
||||||
* @see CollectionTable
|
* <code>ASC</code> (ascending order) is assumed.
|
||||||
* @see JoinTable
|
|
||||||
* @see TableGenerator
|
|
||||||
*
|
*
|
||||||
* @since Java Persistence 2.1
|
* @since Java Persistence 2.1
|
||||||
*
|
*
|
||||||
@@ -51,17 +46,23 @@ public @interface Index {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* (Optional) The name of the index; defaults to a provider-generated name.
|
* (Optional) The name of the index; defaults to a provider-generated name.
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
*/
|
*/
|
||||||
String name() default "";
|
String name() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Required) The names of the columns to be included in the index,
|
* (Required) The names of the columns to be included in the index,
|
||||||
* in order.
|
* in order.
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
*/
|
*/
|
||||||
String columnList();
|
String columnList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Optional) Whether the index is unique.
|
* (Optional) Whether the index is unique.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
boolean unique() default false;
|
boolean unique() default false;
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public @interface Table {
|
|||||||
* annotations and constraints entailed by primary key mappings.
|
* annotations and constraints entailed by primary key mappings.
|
||||||
* <p>
|
* <p>
|
||||||
* Defaults to no additional constraints.
|
* Defaults to no additional constraints.
|
||||||
|
* @return UniqueConstraint[]
|
||||||
*/
|
*/
|
||||||
UniqueConstraint[] uniqueConstraints() default {};
|
UniqueConstraint[] uniqueConstraints() default {};
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ public @interface Table {
|
|||||||
* to specify an index for a primary key, as the primary key
|
* to specify an index for a primary key, as the primary key
|
||||||
* index will be created automatically.
|
* index will be created automatically.
|
||||||
*
|
*
|
||||||
|
* @return indexes
|
||||||
* @since Java Persistence 2.1
|
* @since Java Persistence 2.1
|
||||||
*/
|
*/
|
||||||
Index[] indexes() default {};
|
Index[] indexes() default {};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*******************************************************************************
|
/** *****************************************************************************
|
||||||
* Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
|
* Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials are made available under the
|
* This program and the accompanying materials are made available under the
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* Linda DeMichiel - Java Persistence 2.1
|
* Linda DeMichiel - Java Persistence 2.1
|
||||||
* Linda DeMichiel - Java Persistence 2.0
|
* Linda DeMichiel - Java Persistence 2.0
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
***************************************************************************** */
|
||||||
package javax.persistence;
|
package javax.persistence;
|
||||||
|
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
@@ -27,7 +27,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||||||
* Example:
|
* Example:
|
||||||
* @Entity
|
* @Entity
|
||||||
* @Table(
|
* @Table(
|
||||||
* name="EMPLOYEE",
|
* name="EMPLOYEE",
|
||||||
* uniqueConstraints=
|
* uniqueConstraints=
|
||||||
* @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
|
* @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
|
||||||
* )
|
* )
|
||||||
@@ -36,17 +36,21 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||||||
*
|
*
|
||||||
* @since Java Persistence 1.0
|
* @since Java Persistence 1.0
|
||||||
*/
|
*/
|
||||||
@Target({})
|
@Target({})
|
||||||
@Retention(RUNTIME)
|
@Retention(RUNTIME)
|
||||||
public @interface UniqueConstraint {
|
public @interface UniqueConstraint {
|
||||||
|
|
||||||
/** (Optional) Constraint name. A provider-chosen name will be chosen
|
/** (Optional) Constraint name. A provider-chosen name will be chosen
|
||||||
* if a name is not specified.
|
* if a name is not specified.
|
||||||
*
|
*
|
||||||
|
* @return String
|
||||||
* @since Java Persistence 2.0
|
* @since Java Persistence 2.0
|
||||||
*/
|
*/
|
||||||
String name() default "";
|
String name() default "";
|
||||||
|
|
||||||
/** (Required) An array of the column names that make up the constraint. */
|
/** (Required) An array of the column names that make up the constraint.
|
||||||
|
*
|
||||||
|
* @return String[]
|
||||||
|
*/
|
||||||
String[] columnNames();
|
String[] columnNames();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public interface DistributeTableStrategy<T> {
|
|||||||
* @param table 模板表的表名
|
* @param table 模板表的表名
|
||||||
* @param primary 记录主键
|
* @param primary 记录主键
|
||||||
*
|
*
|
||||||
* @return
|
* @return 带库名的全表名
|
||||||
*/
|
*/
|
||||||
default String getTable(String table, Serializable primary) {
|
default String getTable(String table, Serializable primary) {
|
||||||
return null;
|
return null;
|
||||||
@@ -38,7 +38,7 @@ public interface DistributeTableStrategy<T> {
|
|||||||
* @param table 模板表的表名
|
* @param table 模板表的表名
|
||||||
* @param node 过滤条件
|
* @param node 过滤条件
|
||||||
*
|
*
|
||||||
* @return
|
* @return 带库名的全表名
|
||||||
*/
|
*/
|
||||||
default String getTable(String table, FilterNode node) {
|
default String getTable(String table, FilterNode node) {
|
||||||
return null;
|
return null;
|
||||||
@@ -51,7 +51,7 @@ public interface DistributeTableStrategy<T> {
|
|||||||
* @param table 模板表的表名
|
* @param table 模板表的表名
|
||||||
* @param bean 实体对象
|
* @param bean 实体对象
|
||||||
*
|
*
|
||||||
* @return
|
* @return 带库名的全表名
|
||||||
*/
|
*/
|
||||||
public String getTable(String table, T bean);
|
public String getTable(String table, T bean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ public class FilterNode { //FilterNode 不能实现Serializable接口, 否则
|
|||||||
* @param func EntityInfo的加载器
|
* @param func EntityInfo的加载器
|
||||||
* @param update 是否用于更新的JOIN
|
* @param update 是否用于更新的JOIN
|
||||||
* @param joinTabalis 关联表集合
|
* @param joinTabalis 关联表集合
|
||||||
|
* @param haset 已拼接过的字段名
|
||||||
* @param info Entity类的EntityInfo
|
* @param info Entity类的EntityInfo
|
||||||
*
|
*
|
||||||
* @return SQL的join语句 不存在返回null
|
* @return SQL的join语句 不存在返回null
|
||||||
|
|||||||
Reference in New Issue
Block a user