简体   繁体   English

如何使用QueryDSL获取我的序列nextval?

[英]How can I get my sequence nextval using QueryDSL?

I was digging around to find a solution to this problem using Oracle and the only thing I was able to find so far was the method nextval from com.mysema.query.sql.SQLExpression , but yet I'm not quite sure how to use it and didn't find anything at all even in the documentation. 我正在挖掘使用Oracle找到解决这个问题的方法,到目前为止我唯一能找到的是com.mysema.query.sql.SQLExpression中的 nextval方法,但我还不太清楚如何使用它甚至在文档中也找不到任何东西。

Is there someone who had to use it and also have it figured out? 是否有人不得不使用它并且还想出来了?

Just call 打电话吧

SQLExpressions.nextval("sequence name")

to get an expression of Long type 获得Long类型的表达式

If you need another type you call eg 如果您需要其他类型,请致电例如

SQLExpressions.nextval(Integer.class, "sequence name")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM