Ich habe dies in meiner DAO hinzugefügt:JPA @Query Probleme mit dem zurückgegebene Objekt
@Query("SELECT distinct LBL.cId, LBL from FooBar LBL ORDER BY LBL.collectedAt DESC")
List<FooBar> findDistinctcIdOrderByCollectedAtDesc();
Und dann ist dies in meinem Dienst
List<FooBar> fooBars = this.liveBusLocationDao.findDistinctcIdOrderByCollectedAtDesc();
Und das ist, was ich habe, wenn ich Inhalte debuggen von fooBars
fooBars = {[email protected]} size = 1
0 = {Object[2]@11093}
0 = "string"
1 = {[email protected]} "FooBar(cId=string, internalcId=123456789012, createdAt=2011-11-02 02:59:12.208, collectedAt=2017-10-06 14:26:26.544)"
Wie kann ich dieses Ergebnis durchlaufen?
dies Spring Data JPA nicht die JPA-API. d. h. es gibt keine solche 'JPA @ Query'. vielleicht etikettieren Sie Ihre Frage richtig – DN1