Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
62 views
in Technique[技术] by (71.8m points)

Retrun DTYPE as part of object in JPA Query

I'm trying to retrieve DTYPE from my DB and I have this following JPA query:

@Query("SELECT dtype,kn FROM Knowledge kn")

which returns:

[["Area",{"id":1,"name":"Navy","discoveryDate":"1963-07-04"}]

BUT, I need the result to be:

[{"dtype":"Area","id":1,"name":"Navy","discoveryDate":"1963-07-04"}]

How can I achieve this, please? When selecting @Query("SELECT kn FROM Knowledge kn") the dtype does not return as part of the object.

question from:https://stackoverflow.com/questions/65851728/retrun-dtype-as-part-of-object-in-jpa-query

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...