本文整理汇总了Java中com.mysema.query.types.path.StringPath类的典型用法代码示例。如果您正苦于以下问题:Java StringPath类的具体用法?Java StringPath怎么用?Java StringPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringPath类属于com.mysema.query.types.path包,在下文中一共展示了StringPath类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: datasetColumnAliases
import com.mysema.query.types.path.StringPath; //导入依赖的package包/类
private List<Tuple> datasetColumnAliases(Transaction tx, Expression<?> datasetRel, NumberPath<Integer> datasetRelId, StringPath datasetRelName, int datasetId) {
final QSourceDatasetVersionColumn sourceDatasetVersionColumnSub = new QSourceDatasetVersionColumn("source_dataset_version_column_sub");
final QSourceDatasetVersion sourceDatasetVersionSub = new QSourceDatasetVersion("source_dataset_version_sub");
return tx.query().from(datasetRel)
.join(dataset).on(dataset.id.eq(datasetRelId))
.join(sourceDatasetVersionColumn).on(sourceDatasetVersionColumn.name.eq(datasetRelName))
.join(sourceDatasetVersion).on(sourceDatasetVersion.id.eq(sourceDatasetVersionColumn.sourceDatasetVersionId)
.and(dataset.sourceDatasetId.eq(sourceDatasetVersion.sourceDatasetId)))
.where(datasetRelId.eq(datasetId))
.where(new SQLSubQuery().from(sourceDatasetVersionColumnSub)
.join(sourceDatasetVersionSub).on(sourceDatasetVersionSub.id.eq(sourceDatasetVersionColumnSub.sourceDatasetVersionId))
.where(sourceDatasetVersionColumnSub.name.eq(sourceDatasetVersionColumn.name))
.where(sourceDatasetVersionColumnSub.sourceDatasetVersionId.gt(sourceDatasetVersionColumn.sourceDatasetVersionId))
.where(sourceDatasetVersionSub.sourceDatasetId.eq(dataset.sourceDatasetId))
.notExists())
.where(sourceDatasetVersionColumn.alias.isNotNull())
.orderBy(sourceDatasetVersionColumn.index.desc())
.list(sourceDatasetVersionColumn.name, sourceDatasetVersionColumn.alias);
}
示例2: testQuery
import com.mysema.query.types.path.StringPath; //导入依赖的package包/类
@Test
@Transactional
public void testQuery() throws Exception {
springfieldQueryTemplateRepository.save(new SpringfieldQueryTemplate("a", 1));
springfieldQueryTemplateRepository.save(new SpringfieldQueryTemplate("b", 2));
springfieldQueryTemplateRepository.save(new SpringfieldQueryTemplate("c", 3));
List<SpringfieldQueryTemplate> result = springfieldQueryTemplateRepository.execute(
new TemplateCallback<List<SpringfieldQueryTemplate>, EntityManager>() {
public List<SpringfieldQueryTemplate> doInTemplate(EntityManager em) {
//Using QueryDsl
SpringfieldQueryTemplate alias = Alias.alias(SpringfieldQueryTemplate.class, "foo");
EntityPath<SpringfieldQueryTemplate> foo = Alias.$(alias);
StringPath fooName = Alias.$(alias.getName());
NumberPath<Integer> fooAge = Alias.$(alias.getAge());
JPAQuery query = new JPAQuery(em);
query.from(foo);
query.where(fooName.eq("a"));
query.where(fooAge.eq(1));
return query.list(foo);
}
});
Assert.assertEquals(result.size(), 1);
}
示例3: handleSearchType
import com.mysema.query.types.path.StringPath; //导入依赖的package包/类
/**
* @param path
* @param builder
* @param tuple
* @return
*/
private BooleanExpression handleSearchType(StringPath path,
G_SearchTuple<String> tuple) {
BooleanExpression b = null;
switch (tuple.getSearchType()) {
case COMPARE_CONTAINS:
b = path.contains(tuple.getValue());
break;
case COMPARE_STARTSWITH:
b = path.startsWith(tuple.getValue());
break;
case COMPARE_ENDSWITH:
b = path.endsWith(tuple.getValue());
break;
case COMPARE_EQUALS:
b = path.eq(tuple.getValue());
break;
case COMPARE_REGEX:
b = path.matches(tuple.getValue());
break;
case COMPARE_SIMPLE:
b = path.like("%" + tuple.getValue() + "%");
break;
default:
b = path.contains(tuple.getValue());
break;
}
if (b == null) {
logger.error("Could not make a boolean expression for search type "
+ tuple.getSearchType());
}
return b;
}
示例4: stringPath
import com.mysema.query.types.path.StringPath; //导入依赖的package包/类
@Test
public void stringPath() {
SimplePath<Tuple> aaa = PathExpressions.simplePath("aaa");
StringPath bbb = PathExpressions.stringPath(aaa, "bbb");
assertEquals(String.class, bbb.getType());
assertEquals("bbb", bbb.getMetadata().getName());
assertEquals(aaa, bbb.getMetadata().getParent());
}
示例5: StructureProcessor
import com.mysema.query.types.path.StringPath; //导入依赖的package包/类
StructureProcessor(
StringPath styleIdentificationPath,
StringPath styleNamePath,
StringPath childLayerIdentificationPath,
StringPath parentLayerIdentificationPath,
NumberPath<Integer> layerOrderPath,
BooleanPath cyclePath) {
this.styleIdentificationPath = styleIdentificationPath;
this.styleNamePath = styleNamePath;
this.childLayerIdentificationPath = childLayerIdentificationPath;
this.parentLayerIdentificationPath = parentLayerIdentificationPath;
this.layerOrderPath = layerOrderPath;
this.cyclePath = cyclePath;
}
示例6: stringPath
import com.mysema.query.types.path.StringPath; //导入依赖的package包/类
/**
* 文字列カラムに相当するパスを取得する。
*
* @param parent テーブルのパス。
* @param property カラムの別名。
* @return カラムのパス。
*/
public static StringPath stringPath(Path<?> parent, String property) {
return Expressions.stringPath(parent, property);
}