mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-24 03:57:45 +00:00
Fix: query table entity or sql entity has no id (#1082)
When query table entity or sql entity,include NamedQuery which modified via code and RawSqlQuery which modified via code.
This commit is contained in:
@@ -1107,6 +1107,9 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
}
|
||||
|
||||
public Object idEqualTo(String idName) {
|
||||
if (idName == null) {
|
||||
return null;
|
||||
}
|
||||
if (list.size() == 1) {
|
||||
return list.get(0).getIdEqualTo(idName);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@ public class TestOrderReportTotal extends BaseTestCase {
|
||||
List<OrderAggregate> l2 = q2.findList();
|
||||
assertNotNull(l2);
|
||||
|
||||
Query<OrderAggregate> q3 = Ebean.createQuery(OrderAggregate.class).setRawSql(rawSql);
|
||||
q3.where().eq("order_id", 1);
|
||||
|
||||
OrderAggregate orderAggregate = q3.findUnique();
|
||||
assertNotNull(orderAggregate);
|
||||
}
|
||||
|
||||
private RawSql getRawSql() {
|
||||
|
||||
Reference in New Issue
Block a user