Our prjoect configurations are
I'd like get json column value.
The json column is here:
How can I get "isOption1" property in json column?
The query is here:
By the way, running the query caused an "QuerySyntaxException".
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: with near line 2, column 63 [select tranOrdTest.uid, tranOrdTest.tranOrdKey, tranOrdTest.tranCarOption, tranOrdTest_tranCarOption_0 as isOption1 from tranOrdTest.tranCarOption as tranOrdTest_tranCarOption_0 with key(tranOrdTest_tranCarOption_0) =?1, kr.co.conc.deliveryserver.biz.tr.tranOrd.entity.TranOrdTest tranOrdTest]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: with near line 2, column 63 [select tranOrdTest.uid, tranOrdTest.tranOrdKey, tranOrdTest.tranCarOption, tranOrdTest_tranCarOption_0 as isOption1 from tranOrdTest.tranCarOption as tranOrdTest_tranCarOption_0 with key(tranOrdTest_tranCarOption_0) =?1, kr.co.conc.deliveryserver.biz.tr.tranOrd.entity.TranOrdTest tranOrdTest] org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: with near line 2, column 63 [select tranOrdTest.uid, tranOrdTest.tranOrdKey, tranOrdTest.tranCarOption, tranOrdTest_tranCarOption_0 as isOption1 from tranOrdTest.tranCarOption as tranOrdTest_tranCarOption_0 with key(tranOrdTest_tranCarOption_0) =?1, kr.co.conc.deliveryserver.biz.tr.tranOrd.entity.TranOrdTest tranOrdTest]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: with near line 2, column 63 [select tranOrdTest.uid, tranOrdTest.tranOrdKey, tranOrdTest.tranCarOption, tranOrdTest_tranCarOption_0 as isOption1 from tranOrdTest.tranCarOption as tranOrdTest_tranCarOption_0 with key(tranOrdTest_tranCarOption_0) =?1, kr.co.conc.deliveryserver.biz.tr.tranOrd.entity.TranOrdTest tranOrdTest]
SO how can I resolve this issue?
Please comment if you have the solution for this issue.
Thanks.
I don't want to use native query; I want to use querydsl method.
Query is working except getting json value
but query is not working include the json value.
I want to get "isOption1" property.
Please let me know how can I do that.
Thanks.
You can use Hibernate 6.2 for this purpose, which allows you to map an @Embeddable
to a JSON column like this:
@JdbcTypeCode(SqlTypes.JSON)
@Column(name = "trancaroptions")
TranCarOptions options;
record TranCarOptions(String isOption1 ,String isOption2, String isOption3, String isOption4, String isOption5) {}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.