This commit is contained in:
Redkale
2017-01-17 13:37:34 +08:00
parent da0ff24af6
commit 4071a5d165
5 changed files with 31 additions and 23 deletions

View File

@@ -33,15 +33,10 @@ import java.lang.annotation.Target;
* 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, * <p>
* If <code>ASC</code> or <code>DESC</code> is not specified,
* <code>ASC</code> (ascending order) is assumed. * <code>ASC</code> (ascending order) is assumed.
* *
* @see Table
* @see SecondaryTable
* @see CollectionTable
* @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;

View File

@@ -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 {};

View File

@@ -43,10 +43,14 @@ 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();
} }

View File

@@ -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);
} }

View File

@@ -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