小编Koz*_*kom的帖子

Java、CriteriaBuilder、ORA-00907:缺少右括号

我尝试使用 CriteriaBuilder 而不是编写查询,但是当我测试它时,它给出错误并且无法提取 ResultSet。我在服务中的代码部分:

public List getCategories(String responsibleGroupId) throws Exception {
    CriteriaBuilder builder = entityManager.getCriteriaBuilder();
    CriteriaQuery<SublogTypeMapV> query = builder.createQuery(SublogTypeMapV.class);
    Root<SublogTypeMapV> root = query.from(SublogTypeMapV.class);
    List<Predicate> andPredicates = new ArrayList<>();

    Predicate categoryIdNotNull = builder.isNotNull(root.get(SublogTypeMapV_.categoryId));
    Predicate categotyIdGt = builder.gt(root.get(SublogTypeMapV_.categoryId), 0);
    String[] responsibleGroupListString = responsibleGroupId.split(",");
    Long[] responsibleGroupListLong = new Long[responsibleGroupListString.length];
    for (int i = 0; i < responsibleGroupListString.length; i++) {
        responsibleGroupListLong[i] = Long.valueOf(responsibleGroupListString[i]);
    }
    Predicate responsibleGroup = root.get(SublogTypeMapV_.responsibleGroupId).in(responsibleGroupListLong);
    Predicate getCategories;
    if (responsibleGroupId != null && !responsibleGroupId.equals("0"))
        getCategories = builder.and(categoryIdNotNull, categotyIdGt, responsibleGroup);
    else
        getCategories = …
Run Code Online (Sandbox Code Playgroud)

java hibernate jpa criteria

5
推荐指数
0
解决办法
251
查看次数

Scilab中行/列尺寸不一致的错误

我想在scilab中绘制Limacon,我需要处理以下方程式:

方程式

我知道,r>0l>0

编译以下代码时,在第5行出现此错误:

行/列尺寸不一致。

如果设置t为特定数字,则最终会得到干净的曲线,其中没有任何功能。

我试图改变rl到其它号码,但这并不做任何事情。有人知道我在做什么错吗?

r=1;
l=1;
t=linspace(0,2,10);
x = 2 * r * (cos(t))^2 + l * cos(t);
y = 2 * r * cos(t) * sin(t) + l * sin(t);
plot (x,y);
Run Code Online (Sandbox Code Playgroud)

matlab scilab

2
推荐指数
1
解决办法
2260
查看次数

标签 统计

criteria ×1

hibernate ×1

java ×1

jpa ×1

matlab ×1

scilab ×1