Announcement Announcement Module
Collapse
No announcement yet.
Select...in() clause with Sprign Data JPA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Select...in() clause with Sprign Data JPA

    Hi!

    I have found that using a very common query like this:

    @Query(nativeQuery=true, value="select * from questions where id in (22,45,65,777,444)") results in a list of objects instead of a list of questions object.

    [[Ljava.lang.Object;@49fd8d8f, [Ljava.lang.Object;@2558cd3c, [Ljava.lang.Object;@690a314b]

    This situation is going to be fixed?

    How can I manage this right now?

    Thanks!

  • #2
    Is there a reason for you to use a native query when

    Code:
        public List<Question> findByIdIn(List<Integer> ids);
    seems to be what you want?

    If you have more complex native queries, you might to google @SqlResultSetMappings. I haven't used this, so the suggestion might be off-base.

    Comment


    • #3
      This is the point.

      I have a more complex query to be executed and the example shows that even with a simple query like that one I posted, the problem is the same.

      Comment

      Working...
      X