基本上我想实现类似的目标:
package foo.bar.data.dao;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import foo.bar.data.model.User;
public interface User extends JpaRepository<User, Long> {
...
@Query("SELECT NEW java.lang.Long(MAX(u.ID)) FROM USER u")
//Long findMaxUserId();
List<Long> findMaxUserId();
}
但没有列表