Paweł Baczyński wrote:First, if you need to sort in reverse order, don't use thenComparing(). Use reversed() directly on your original comparator.
Second, if the compiler can not determine the type of s in the lambda you can specify it.
So you'll have
.sorted(Comparator.comparingDouble((Transaction s) -> s.getAmount()).reversed())
It would be even nicer to use a method reference:
.sorted(Comparator.comparingDouble(Transaction::getAmount).reversed())
[junit] StatementCallback; bad SQL grammar [SELECT user_seq_id, username, pa
ssword FROM users_tbl]; nested exception is java.sql.SQLException: user lacks pr
ivilege or object not found: USERS_TBL
[junit] org.springframework.jdbc.BadSqlGrammarException: StatementCallback;
bad SQL grammar [SELECT user_seq_id, username, password FROM users_tbl]; nested
exception is java.sql.SQLException: user lacks privilege or object not found: US
ERS_TBL
[junit] at org.springframework.jdbc.support.SQLStateSQLExceptionTranslat
or.doTranslate(SQLStateSQLExceptionTranslator.java:98)
[junit] at org.springframework.jdbc.support.AbstractFallbackSQLException
Translator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
[junit] at org.springframework.jdbc.support.AbstractFallbackSQLException
Translator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
[junit] at org.springframework.jdbc.support.AbstractFallbackSQLException
Translator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
[junit] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTempla
te.java:406)
[junit] at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate
.java:455)
[junit] at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate
.java:463)
[junit] at com.mycompany.dao.spring.UserDAOSpringImpl.findUsers(UserDAO
SpringImpl.java:77)