Skip to content

Support direct DTO mapping for repository query methods #1147

@Zaky7

Description

@Zaky7

Hi,

I am writing a custom query but as I am not able to cast the expression to some custom objects. In JPA you can do write custom queries like

@Query("SELECT new com.baeldung.aggregation.model.custom.CommentCount(c.year, COUNT(c.year)) "
  + "FROM Comment AS c GROUP BY c.year ORDER BY c.year DESC")
List<CommentCount> countTotalCommentsByYearClass(); 

But with ReactiveCassandraRepository I am getting errors org.springframework.data.cassandra.CassandraQuerySyntaxException:

How can I cast to custom object in ReactiveCassandraRepository?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions