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


Java Path类代码示例

本文整理汇总了Java中com.querydsl.core.types.Path的典型用法代码示例。如果您正苦于以下问题:Java Path类的具体用法?Java Path怎么用?Java Path使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Path类属于com.querydsl.core.types包,在下文中一共展示了Path类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pathName

import com.querydsl.core.types.Path; //导入依赖的package包/类
/**
 * Query name of given path. A dot-notation pattern is used to express nested properties path.
 * @param path Path
 * @return Path query name
 */
private static String pathName(Path<?> path) {
	if (path != null) {
		StringBuilder sb = new StringBuilder();
		if (!path.getMetadata().isRoot()) {
			Path<?> parent = path.getMetadata().getParent();
			if (!parent.getMetadata().isRoot()) {
				String parentName = pathName(parent);
				if (parentName != null) {
					sb.append(parentName);
					sb.append(".");
				}
			}
		}
		sb.append(path.getMetadata().getName());
		return sb.toString();
	}
	return null;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:24,代码来源:DefaultQueryDslProperty.java

示例2: expressionsForProperty

import com.querydsl.core.types.Path; //导入依赖的package包/类
/**
 * Get a Map of expressions for the given property and path. Add it to the
 * given Map, or a new Map.
 *
 * @param property The property to get expressions for.
 * @param qPath The path to get expressions for.
 * @param target The Map to add to. If null a new Map will be created.
 * @return The target Map, or a new Map if target was null.
 */
public static Map<String, Expression<?>> expressionsForProperty(EntityProperty property, Path<?> qPath, Map<String, Expression<?>> target) {
    Map<Class, Map<String, ExpressionFactory>> innerMap = EP_MAP_MULTI.get(property);
    if (innerMap == null) {
        throw new IllegalArgumentException("We do not know any property called " + property.toString());
    }
    Map<String, ExpressionFactory> coreMap = innerMap.get(qPath.getClass());
    if (coreMap == null) {
        throw new IllegalArgumentException("No property called " + property.toString() + " for " + qPath.getClass());
    }
    if (target == null) {
        target = new LinkedHashMap<>();
    }
    for (Map.Entry<String, ExpressionFactory> es : coreMap.entrySet()) {
        target.put(es.getKey(), es.getValue().get(qPath));
    }
    return target;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:27,代码来源:PropertyResolver.java

示例3: applyPaginationWithPageableHavingAPropertyNotIncludedInTheAttributeMappingShouldNotFail

import com.querydsl.core.types.Path; //导入依赖的package包/类
/**
 * Test method for {@link io.springlets.data.jpa.repository.support.QueryDslRepositorySupportExt#applyPagination(org.springframework.data.domain.Pageable, com.querydsl.jpa.JPQLQuery, java.util.Map)}.
 */
@Test
public void applyPaginationWithPageableHavingAPropertyNotIncludedInTheAttributeMappingShouldNotFail() {
  // Prepare
  Sort.Order order = new Sort.Order("test");

  Map<String, Path<?>[]> attributeMapping = new HashMap<>();
  when(pageable.getSort()).thenReturn(sort);
  when(pageable.getPageSize()).thenReturn(1);
  when(sort.iterator()).thenReturn(iterator);
  when(iterator.hasNext()).thenReturn(true).thenReturn(false);
  when(iterator.next()).thenReturn(order).thenThrow(new NoSuchElementException());

  // Exercise & verify
  support.applyPagination(pageable, null, attributeMapping);
}
 
开发者ID:DISID,项目名称:springlets,代码行数:19,代码来源:QueryDslRepositorySupportExtTest.java

示例4: DefaultQueryDslProperty

import com.querydsl.core.types.Path; //导入依赖的package包/类
/**
 * Constructor
 * @param path Property path (required not null)
 */
@SuppressWarnings("null")
public DefaultQueryDslProperty(Path<T> path) {
	super(pathName(path), (path != null) ? path.getType() : null);
	ObjectUtils.argumentNotNull(path, "Path must be not null");
	this.path = path;
	// set parent
	if (path.getRoot() != null) {
		parent(JpaTarget.of(path.getRoot().getType()));
	}
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:15,代码来源:DefaultQueryDslProperty.java

示例5: getExpressions

import com.querydsl.core.types.Path; //导入依赖的package包/类
public static Expression<?>[] getExpressions(Path<?> qPath, Set<EntityProperty> selectedProperties) {
    List<Expression<?>> exprList = new ArrayList<>();
    if (selectedProperties.isEmpty()) {
        PropertyResolver.expressionsForClass(qPath, exprList);
    } else {
        for (EntityProperty property : selectedProperties) {
            PropertyResolver.expressionsForProperty(property, qPath, exprList);
        }
    }
    return exprList.toArray(new Expression<?>[exprList.size()]);
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:12,代码来源:PropertyHelper.java

示例6: expressionForProperty

import com.querydsl.core.types.Path; //导入依赖的package包/类
public static Expression<?> expressionForProperty(EntityProperty property, Path<?> qPath) {
    Map<Class, ExpressionFactory> innerMap = EP_MAP_SINGLE.get(property);
    if (innerMap == null) {
        throw new IllegalArgumentException("ObservedProperty has no property called " + property.toString());
    }
    return innerMap.get(qPath.getClass()).get(qPath);
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:8,代码来源:PropertyResolver.java

示例7: expressionsForClass

import com.querydsl.core.types.Path; //导入依赖的package包/类
/**
 *
 * @param qPath The path to get expressions for.
 * @param target The list to add to. If null a new list will be created.
 * @return The target list, or a new list if target was null.
 */
public static List<Expression<?>> expressionsForClass(Path<?> qPath, List<Expression<?>> target) {
    List<ExpressionFactory> list = ALL_FOR_CLASS.get(qPath.getClass());
    if (target == null) {
        target = new ArrayList<>();
    }
    for (ExpressionFactory f : list) {
        target.add(f.get(qPath));
    }
    return target;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:17,代码来源:PropertyResolver.java

示例8: SQSrvaMethod

import com.querydsl.core.types.Path; //导入依赖的package包/类
public SQSrvaMethod(Path<? extends SQSrvaMethod> path) {
    super(path.getType(), path.getMetadata(), "public", "srva_method");
    addMetadata();
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:5,代码来源:SQSrvaMethod.java

示例9: QTest

import com.querydsl.core.types.Path; //导入依赖的package包/类
public QTest(Path<? extends Test> path) {
	this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:4,代码来源:QTest.java

示例10: getPath

import com.querydsl.core.types.Path; //导入依赖的package包/类
@Override
public Path<T> getPath() {
	return path;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:5,代码来源:DefaultQueryDslProperty.java

示例11: QSubNested

import com.querydsl.core.types.Path; //导入依赖的package包/类
public QSubNested(Path<? extends SubNested> path) {
	super(path.getType(), path.getMetadata());
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:4,代码来源:QSubNested.java

示例12: QTestJpaDomain

import com.querydsl.core.types.Path; //导入依赖的package包/类
public QTestJpaDomain(Path<? extends TestJpaDomain> path) {
	this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:4,代码来源:QTestJpaDomain.java

示例13: QTestOtherDomain

import com.querydsl.core.types.Path; //导入依赖的package包/类
public QTestOtherDomain(Path<? extends TestOtherDomain> path) {
	super(path.getType(), path.getMetadata());
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:4,代码来源:QTestOtherDomain.java

示例14: QTestNested

import com.querydsl.core.types.Path; //导入依赖的package包/类
public QTestNested(Path<? extends TestNested> path) {
	this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:4,代码来源:QTestNested.java

示例15: addInParameter

import com.querydsl.core.types.Path; //导入依赖的package包/类
public <T> StoredProcedureQueryBuilder addInParameter(Path<T> parameter, T value) {
    Class type = parameter.getType();
    inParameters.add(new Parameter(type, parameter.getMetadata().getName(), value));
    return this;
}
 
开发者ID:infobip,项目名称:infobip-spring-data-jpa-querydsl,代码行数:6,代码来源:StoredProcedureQueryBuilder.java


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