mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1406 - ENH: Add SqlQuery.findSingleAttributeList() ... for returning lists of scalar values via SqlQuery
This commit is contained in:
@@ -462,6 +462,11 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> findSingleAttributeList(SpiSqlQuery query, Class<T> cls) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SqlQuery createSqlQuery(String sql) {
|
||||
return null;
|
||||
|
||||
@@ -20,6 +20,20 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class SqlQueryTests extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void findSingleAttributeList_decimal() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
String sql = "select (unit_price * order_qty) from o_order_detail where unit_price > ? order by (unit_price * order_qty) desc";
|
||||
|
||||
List<BigDecimal> lineAmounts = Ebean.createSqlQuery(sql)
|
||||
.setParameter(1, 3)
|
||||
.findSingleAttributeList(BigDecimal.class);
|
||||
|
||||
assertThat(lineAmounts).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void findSingleAttribute_decimal() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user