本文整理匯總了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[]{});
}