Hibernate - createNativeQuery with “non-entity class” result

前端 未结 6 1906
清酒与你
清酒与你 2021-01-04 20:13

I\'m new to all this Hibernate/JPA stuff, so i will try to be as clear as possible.

Is there any way in Hibernate to use createNativeQuery to select a single/or mult

6条回答
  •  旧巷少年郎
    2021-01-04 20:49

    Just try to call createNativeQuery() without passing String.class. If the name column is of string-type in database query.getSingleResult() will actually return a String.

提交回复
热议问题