本文整理汇总了Java中com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable类的典型用法代码示例。如果您正苦于以下问题:Java DbTable类的具体用法?Java DbTable怎么用?Java DbTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DbTable类属于com.healthmarketscience.sqlbuilder.dbspec.basic包,在下文中一共展示了DbTable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCustomPrefix
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; //导入依赖的package包/类
public void testCustomPrefix() throws Exception
{
DbTable table = new DbSpec("pre_").addDefaultSchema().addTable("NewTable");
table.addColumn("col1");
table.addColumn("col2");
String sqlStr = new SelectQuery().addAllTableColumns(table)
.validate().toString();
checkResult(sqlStr, "SELECT pre_0.* FROM NewTable pre_0");
}
示例2: getDbTable
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; //导入依赖的package包/类
public DbTable getDbTable() {
return dbTable;
}
示例3: buildColumns
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; //导入依赖的package包/类
protected void buildColumns() throws OlapException {
DbTable fromTable = null;
for(ResultAxis axis : resultAxes){
for(LevelMemberSet layer : axis.getLayers()){
if(layer.isMeasure()){
for(Member m : layer.getMembers()){
TableMapping.MeasureMapping mmap = mapping.getMapping((ServerMeasure) m);
sql.addAliasedColumn(mmap.column.getExpression(), mmap.alias);
}
}else if(layer.getLevel() instanceof ServerLevel){
TableMapping.LevelMapping lmap = mapping.getMapping(layer.getLevel());
fromTable = lmap.name_column.getDbColumn().getTable();
sql.addAliasedColumn(lmap.name_column.getDbColumn(), lmap.name_alias);
if(lmap.key_column!=lmap.name_column){
if(lmap.key_column==null)
throw new OlapException("Key column for name:"+lmap.name_column.column+" not defined in tables.json, layer "+layer.toString());
sql.addAliasedColumn(lmap.key_column.getDbColumn(), lmap.key_alias);
addGroupedBy(lmap.key_column.getDbColumn());
}
if(lmap.order_column!=lmap.name_column && lmap.order_column!=lmap.key_column){
addGroupedBy(lmap.order_column.getDbColumn());
}
layer.setSorter(new Sorter(lmap.order_column.getDbColumn(), lmap.order_column.sort_direction));
addGroupedBy(lmap.name_column.getDbColumn());
addJoin(lmap.join);
}
}
}
if(fromTable==null){
log.debug("Adding from table:"+mapping.getAggregate().getDbTable().getName());
sql.addFromTable(mapping.getAggregate().getDbTable());
}
}