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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…