• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StringExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: visit

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
public Expression<?> visit(Substring node) {
    List<de.fraunhofer.iosb.ilt.sta.query.expression.Expression> params = node.getParameters();
    de.fraunhofer.iosb.ilt.sta.query.expression.Expression p1 = node.getParameters().get(0);
    de.fraunhofer.iosb.ilt.sta.query.expression.Expression p2 = node.getParameters().get(1);
    Expression<?> e1 = p1.accept(this);
    Expression<?> e2 = p2.accept(this);
    StringExpression s1 = getSingleOfType(StringExpression.class, e1);
    NumberExpression n2 = getSingleOfType(NumberExpression.class, e2);
    if (params.size() > 2) {
        de.fraunhofer.iosb.ilt.sta.query.expression.Expression p3 = node.getParameters().get(2);
        Expression<?> e3 = p3.accept(this);
        NumberExpression n3 = getSingleOfType(NumberExpression.class, e3);
        return s1.substring(n2, n3);
    }
    return s1.substring(n2);
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:18,代码来源:PgExpressionHandler.java


示例2: checkType

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public static <T extends Expression<?>> T checkType(Class<T> expectedClazz, Expression<?> input, boolean canCast) {
    if (expectedClazz.isAssignableFrom(input.getClass())) {
        LOGGER.debug("Is {}: {} ({} -- {})", expectedClazz.getName(), input, input.getClass().getName(), input.getType().getName());
        return expectedClazz.cast(input);
    } else {
        if (canCast && StringExpression.class.equals(expectedClazz) && input instanceof NumberPath) {
            NumberPath numberPath = (NumberPath) input;
            return (T) numberPath.stringValue();
        }
        LOGGER.debug("Not a {}: {} ({} -- {})", expectedClazz.getName(), input, input.getClass().getName(), input.getType().getName());
        throw new IllegalArgumentException("Could not convert parameter of type " + input.getClass().getName() + " to type " + expectedClazz.getName());
    }
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:14,代码来源:PgExpressionHandler.java


示例3: createPointWithDefaultSRID

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public static GeometryExpression<?> createPointWithDefaultSRID(@Nonnull final NumberPath<Integer> longitude,
                                                               @Nonnull final NumberPath<Integer> latitude) {

    Objects.requireNonNull(longitude, "longitude must not be null");
    Objects.requireNonNull(latitude, "latitude must not be null");

    final StringExpression point = longitude.stringValue()
            .prepend(constant("POINT("))
            .concat(constant(" "))
            .concat(latitude.stringValue())
            .concat(constant(")"));

    return GeometryExpressions.setSRID(fromText(point), SRID.ETRS_TM35FIN.getValue());
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:15,代码来源:GISUtils.java


示例4: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
    default public void customize(QuerydslBindings bindings, QCustomer cust) {

//        bindings.bind(cust.firstName).first(StringExpression::containsIgnoreCase);

        bindings
                .bind(String.class)
                .first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);

        bindings
                .bind(Long.class)
                .first((SingleValueBinding<NumberPath<Long>, Long>) NumberExpression::goe);

//        bindings.excluding(cust.lastName);
    }
 
开发者ID:Nandtel,项目名称:spring-data-jpa-querydsl-gradle-starter,代码行数:16,代码来源:CustomerRepository.java


示例5: equal

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private BooleanExpression equal(StringExpression stringPath, String valueArgument) {
    if (valueArgument.startsWith(WILDCARD) && valueArgument.endsWith(WILDCARD)) {
        return stringPath.containsIgnoreCase(sanitizeWildcard(valueArgument));
    } else if (valueArgument.endsWith(WILDCARD)) {
        return stringPath.startsWithIgnoreCase(sanitizeWildcard(valueArgument));
    } else if (valueArgument.startsWith(WILDCARD)) {
        return stringPath.endsWithIgnoreCase(sanitizeWildcard(valueArgument));
    } else {
        return stringPath.equalsIgnoreCase(valueArgument);
    }
}
 
开发者ID:vineey,项目名称:archelix-rsql,代码行数:12,代码来源:StringPathConverter.java


示例6: ConstantDurationExpression

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public ConstantDurationExpression(final StringExpression duration) {
    this.duration = duration;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:4,代码来源:ConstantDurationExpression.java


示例7: getDuration

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public StringExpression getDuration() {
    return duration;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:4,代码来源:ConstantDurationExpression.java


示例8: replaceAll

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private static StringTemplate replaceAll(StringExpression string, String pattern, String replacement) {
    return _replaceAll(string, pattern, replacement);
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:4,代码来源:HuntingClubNameValidationFeature.java


示例9: handle

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private Predicate handle(Expression expression, FilterOperator operator, Object value) { // NOSONAR
	// checking multiple comparision implementations is a mess, created
	// https://github.com/querydsl/querydsl/issues/2028
	if (operator == FilterOperator.EQ || operator == FilterOperator.NEQ) {
		return handleEquals(expression, operator, value);
	}
	else if (operator == FilterOperator.LIKE) {
		return ((StringExpression) expression).lower().like(value.toString().toLowerCase());
	}
	else if (operator == FilterOperator.GT) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).gt((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).gt((Number) value);
		}
		else {
			return ((ComparableExpression) expression).gt((Comparable) value);
		}
	}
	else if (operator == FilterOperator.LT) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).lt((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).lt((Number) value);
		}
		else {
			return ((ComparableExpression) expression).lt((Comparable) value);
		}
	}
	else if (operator == FilterOperator.GE) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).goe((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).goe((Number) value);
		}
		else {
			return ((ComparableExpression) expression).goe((Comparable) value);
		}
	}
	else if (operator == FilterOperator.LE) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).loe((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).loe((Number) value);
		}
		else {
			return ((ComparableExpression) expression).loe((Comparable) value);
		}
	}
	else {
		throw new IllegalStateException("unexpected operator " + operator);
	}

}
 
开发者ID:katharsis-project,项目名称:katharsis-framework,代码行数:59,代码来源:QuerydslQueryBackend.java


示例10: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QCustomer root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::startsWithIgnoreCase);
    bindings.bind(Long.class).first((SingleValueBinding<NumberPath<Long>, Long>) NumberExpression::in);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:6,代码来源:CustomerRepository.java


示例11: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QContact root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:ContactRepository.java


示例12: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QUser root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
    bindings.excluding(root.password);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:6,代码来源:UserRepository.java


示例13: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QGroup root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:GroupRepository.java


示例14: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QRole root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:RoleRepository.java


示例15: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QAuthority root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:AuthorityRepository.java


示例16: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QDashboardBox root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:DashboardBoxRepository.java


示例17: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QDashboardBoxType root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:DashboardBoxTypeRepository.java


示例18: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QDashboard root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:DashboardRepository.java


示例19: querySchemeUsers

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private QueryResultWithCount<SchemeUserDTO> querySchemeUsers(final int pageIndex,
    final long schemeId, final String userName, final boolean currentTimeRanges) {
  return querydslSupport.execute((connection, configuration) -> {
    QDateRange qDateRange = QDateRange.dateRange;
    QCwdUser qCwdUser = QCwdUser.cwdUser;

    SQLQuery<SchemeUserDTO> query = new SQLQuery<>(connection, configuration);
    query.from(qUserSchemeEntityParameter.userSchemeEntityPath)
        .innerJoin(qDateRange)
        .on(qDateRange.dateRangeId.eq(qUserSchemeEntityParameter.dateRangeId))
        .innerJoin(qCwdUser).on(qCwdUser.id.eq(qUserSchemeEntityParameter.userId));

    QAvatar qAvatar = AvatarUtil.joinAvatarToCwdUser(query, qCwdUser, "avatar");

    List<Predicate> predicates = new ArrayList<>();
    predicates.add(qUserSchemeEntityParameter.userSchemeSchemeId.eq(schemeId));

    if (currentTimeRanges) {
      Date currentDate = new Date(new java.util.Date().getTime());
      predicates.add(qDateRange.startDate.loe(currentDate)
          .and(qDateRange.endDateExcluded.gt(currentDate)));
    }

    if (userName != null) {
      predicates.add(qCwdUser.userName.eq(userName));
    }

    Expression<Long> defaultAvatarId = ConstantImpl.create(AvatarUtil.DEFAULT_AVATAR_ID);

    StringExpression userDisplayNameExpression = qCwdUser.displayName.as("userDisplayName");
    query.select(Projections.fields(SchemeUserDTO.class,
        qUserSchemeEntityParameter.userSchemeId.as("userSchemeId"), qDateRange.dateRangeId,
        qCwdUser.userName, userDisplayNameExpression, qDateRange.startDate,
        qDateRange.endDateExcluded,
        new Coalesce<>(Long.class, qAvatar.id, defaultAvatarId).as("avatarId"),
        qAvatar.owner.as("avatarOwner")));

    query.where(predicates.toArray(new Predicate[0]));

    long count = query.fetchCount();

    query.orderBy(userDisplayNameExpression.asc(), qDateRange.startDate.desc());
    long offset = PAGE_SIZE * (pageIndex - 1);
    if (offset >= count) {
      offset = PAGE_SIZE * (count / PAGE_SIZE - 1);
      if (offset < 0) {
        offset = 0;
      }
    }

    List<SchemeUserDTO> resultSet;
    if (offset >= count) {
      resultSet = Collections.emptyList();
    } else {
      resultSet = query.limit(PAGE_SIZE).offset(offset).fetch();
    }

    QueryResultWithCount<SchemeUserDTO> result = new QueryResultWithCount<>(resultSet, count);
    return result;
  });
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:62,代码来源:SchemeUsersComponent.java


示例20: getByFieldIgnoreCase

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
protected <T extends E> T getByFieldIgnoreCase(EntityPath<T> entityPath, StringExpression field, String fieldValue) {
	return queryByPredicate(entityPath, eqIgnoreCaseOrIsNull(field, fieldValue)).fetchOne();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:AbstractEntityDaoImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DcMotorController类代码示例发布时间:2022-05-22
下一篇:
Java GwtMockito类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap