本文整理汇总了Java中io.requery.Table类的典型用法代码示例。如果您正苦于以下问题:Java Table类的具体用法?Java Table怎么用?Java Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于io.requery包,在下文中一共展示了Table类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tableName
import io.requery.Table; //导入依赖的package包/类
@Override
public String tableName() {
return annotationOf(Table.class).map(Table::name)
.orElse( annotationOf(javax.persistence.Table.class)
.map(javax.persistence.Table::name)
.orElse( annotationOf(View.class).map(View::name)
.orElse( element().getKind().isInterface() || isImmutable() ?
element().getSimpleName().toString() :
Names.removeClassPrefixes(element().getSimpleName()))));
}
示例2: tableUniqueIndexes
import io.requery.Table; //导入依赖的package包/类
@Override
public String[] tableUniqueIndexes() {
if (annotationOf(javax.persistence.Table.class).isPresent()) {
Index[] indexes = annotationOf(javax.persistence.Table.class)
.map(javax.persistence.Table::indexes)
.orElse(new Index[0]);
Set<String> names = Stream.of(indexes).filter(Index::unique)
.map(Index::name).collect(Collectors.toSet());
return names.toArray(new String[names.size()]);
}
return annotationOf(Table.class).map(Table::uniqueIndexes).orElse(new String[]{});
}
示例3: getMappedName
import io.requery.Table; //导入依赖的package包/类
private PropertyName getMappedName(Annotated annotated) {
if (annotated.hasAnnotation(Table.class)) {
Table table = annotated.getAnnotation(Table.class);
return new PropertyName(table.name());
} if (annotated.hasAnnotation(View.class)) {
View view = annotated.getAnnotation(View.class);
return new PropertyName(view.name());
} else if (annotated.hasAnnotation(Column.class)) {
Column column = annotated.getAnnotation(Column.class);
return new PropertyName(column.name());
} else {
return null;
}
}
示例4: tableAttributes
import io.requery.Table; //导入依赖的package包/类
@Override
public String[] tableAttributes() {
return annotationOf(Table.class).map(Table::createAttributes).orElse(new String[]{});
}