79127335

Date: 2024-10-25 21:22:01
Score: 2
Natty:
Report link

Does something like below will work for you? If not why?

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;

public interface TestVersionRepository extends JpaRepository<TestVersion, Long> {

    @Query("SELECT tv FROM TestVersion tv " +
           "WHERE tv.version = (SELECT max(tv2.version) FROM TestVersion tv2 " +
           "WHERE tv2.identification = tv.identification) " +
           "ORDER BY tv.identification, tv.majorVersion DESC, tv.minorVersion DESC, tv.patchVersion DESC")
    List<TestVersion> findLatestVersions();
}
Reasons:
  • Blacklisted phrase (0.5): why?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Ebuzer Taha KANAT