0

When I tried to return result it will show return type mismatch. What can I do?

        @Override
        @SuppressWarnings("unchecked")
        public List<StudentDetail> getAllStudent(){
        DetachedCriteria.forClass(QrCodeList.class).add(Property.forName("userId")
                    .eq(
                              DetachedCriteria.forClass(User.class).setProjection(Property.forName("id"))
                            )
                          );

        }
halfer
  • 19,824
  • 17
  • 99
  • 186
sathish
  • 59
  • 1
  • 6
  • What is your exact error? Please add it to the question. I don't think there is enough detail for people to help here, so if you can add more detail, please do. – halfer Jun 13 '16 at 18:11

1 Answers1

0

It seems like this method returns DetachedCriteria<QrCodeList>. To make it return List it should be like

    DetachedCriteria.forClass(QrCodeList.class).add(Property.forName("userId")
                .eq(DetachedCriteria.forClass(User.class).setProjection(Property.forName("id")))
                      ).list()

But it would be List<QrCodeList>

Alisa
  • 1