public class DbKey<T>
复合主键, 包含多个字段 1 CharSequence接口 为了适配 DbQueryBuilderDecoration 中的条件方法的参数类型, 如 where() 否则要重载很多方法来接收 DbKeyName 参数
2 data class 不用手动实现 equals() 方法
3 访问权限 原来想限制类的访问权限为 internal, 但是 IOrmMeta 与 IRelationMeta 的主键外键属性都>直接暴露了该类 那只好限制扩展方法了
4 复合主键中字段值不能为null All parts of a PRIMARY KEY must be NOT NULL
| 限定符和类型 | 类和说明 |
|---|---|
static class |
DbKey.Companion |
| 限定符和类型 | 字段和说明 |
|---|---|
static DbKey.Companion |
Companion |
T[] |
columns |
| 构造器和说明 |
|---|
DbKey(T columns) |
| 限定符和类型 | 方法和说明 |
|---|---|
<S> boolean |
allColumnWith(DbKey<S> o,
kotlin.jvm.functions.Function2<? super T,? super S,java.lang.Boolean> predicate)
Returns
true if all elements match the given predicate. |
<S> boolean |
anyColumnWith(DbKey<S> o,
kotlin.jvm.functions.Function2<? super T,? super S,java.lang.Boolean> predicate)
Returns
true if at least one element matches the given predicate. |
boolean |
equals(java.lang.Object o)
检查元素值相等
在 OrmQueryBuilder.setHasManyProp() 中用于匹配一对多的外键来设置关联属性
|
T |
first()
第一个字段
|
void |
forEachColumn(kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action)
遍历每个字段
|
<S> void |
forEachColumnWith(DbKey<S> other,
kotlin.jvm.functions.Function3<? super T,? super S,? super java.lang.Integer,kotlin.Unit> action)
与另外一个主键 遍历字段
|
T |
getColumn(int i)
访问字段
|
T[] |
getColumns() |
int |
getSize()
字段个数
|
int |
hashCode() |
<R> DbKey<R> |
map(kotlin.jvm.functions.Function1<? super T,? extends R> transform)
遍历并生成新的主键
|
<R> DbKey<R> |
mapTo(java.lang.Object[] newKeys,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
遍历并生成新的主键
|
<S,R> DbKey<R> |
mapWith(DbKey<S> other,
kotlin.jvm.functions.Function2<? super T,? super S,? extends R> transform)
与另外一个主键 遍历并生成新的主键
|
void |
setColumns(T[] p) |
T |
single()
唯一一个字段
|
java.util.List<T> |
toList()
转为列表
|
java.lang.String |
toString() |
public T[] columns
public static DbKey.Companion Companion
public T[] getColumns()
public void setColumns(T[] p)
public int getSize()
字段个数
public T first()
第一个字段
public T single()
唯一一个字段
public java.util.List<T> toList()
转为列表
public <R> DbKey<R> map(kotlin.jvm.functions.Function1<? super T,? extends R> transform)
遍历并生成新的主键
public <R> DbKey<R> mapTo(java.lang.Object[] newKeys, kotlin.jvm.functions.Function1<? super T,? extends R> transform)
遍历并生成新的主键
public <S,R> DbKey<R> mapWith(DbKey<S> other, kotlin.jvm.functions.Function2<? super T,? super S,? extends R> transform)
与另外一个主键 遍历并生成新的主键
public void forEachColumn(kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action)
遍历每个字段
public <S> void forEachColumnWith(DbKey<S> other, kotlin.jvm.functions.Function3<? super T,? super S,? super java.lang.Integer,kotlin.Unit> action)
与另外一个主键 遍历字段
public <S> boolean anyColumnWith(DbKey<S> o, kotlin.jvm.functions.Function2<? super T,? super S,java.lang.Boolean> predicate)
Returns true if at least one element matches the given predicate.
Unresolved: samples.collections.Collections.Aggregates.anyWithPredicate
public <S> boolean allColumnWith(DbKey<S> o, kotlin.jvm.functions.Function2<? super T,? super S,java.lang.Boolean> predicate)
Returns true if all elements match the given predicate.
Unresolved: samples.collections.Collections.Aggregates.all
public T getColumn(int i)
访问字段
public boolean equals(java.lang.Object o)
检查元素值相等 在 OrmQueryBuilder.setHasManyProp() 中用于匹配一对多的外键来设置关联属性
public int hashCode()
public java.lang.String toString()