This is an automated email from the ASF dual-hosted git repository.
doebele pushed a commit to branch version3
in repository https://gitbox.apache.org/repos/asf/empire-db.git
The following commit(s) were added to refs/heads/version3 by this push:
new 30aa2df EMPIREDB-362 example carSalesDB update
30aa2df is described below
commit 30aa2df16f467b5188d28aafb44cae7c67fed101
Author: Rainer Döbele <[email protected]>
AuthorDate: Mon Feb 14 17:43:15 2022 +0100
EMPIREDB-362 example carSalesDB update
---
.../apache/empire/samples/db/advanced/CarSalesDB.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git
a/empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/CarSalesDB.java
b/empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/CarSalesDB.java
index fab69d4..0fbccc6 100644
---
a/empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/CarSalesDB.java
+++
b/empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/CarSalesDB.java
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.SQLException;
import java.time.LocalDate;
+import java.util.List;
import org.apache.empire.commons.ObjectUtils;
import org.apache.empire.data.DataType;
@@ -357,7 +358,21 @@ public class CarSalesDB extends TDatabase<CarSalesDB>
for (int i=0; i<entry.getFieldCount(); i++)
log.info("col {} -> {}", entry.getColumn(i).getName(),
entry.getColumn(i).getBeanPropertyName());
- QueryResult res = context.getUtils().queryBean(cmd, QueryResult.class);
+ List<QueryResult> list = context.getUtils().queryBeanList(cmd,
QueryResult.class, null);
}
+
+ public void updateDemo(DBContext context)
+ {
+
+ DBCommand cmd = createCommand()
+ .set (MODEL.BASE_PRICE.to(55000)) // set the price-tag
+ .join (MODEL.BRAND_ID, BRAND.ID)
+ .where(BRAND.NAME.is("Tesla"))
+ .where(MODEL.NAME.is("Model 3").and(MODEL.TRIM.is("Performance")));
+
+ // and off you go...
+ context.executeUpdate(cmd);
+ }
+
}