当前位置: 首页>>代码示例>>Java>>正文


Java StringPath类代码示例

本文整理汇总了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);
}
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:21,代码来源:DatasetMetadata.java

示例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);
}
 
开发者ID:u2ware,项目名称:springfield,代码行数:29,代码来源:SpringfieldQueryTemplateTest.java

示例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;
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:39,代码来源:EntityRefDAOImpl.java

示例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());
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:9,代码来源:PathExpressionsTest.java

示例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;
}
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:16,代码来源:StructureProcessor.java

示例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);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:11,代码来源:PathExpressions.java


注:本文中的com.mysema.query.types.path.StringPath类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。