You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by do...@apache.org on 2026/02/01 14:08:58 UTC

(empire-db) branch master updated (f8003990 -> e74d35c2)

This is an automated email from the ASF dual-hosted git repository.

doebele pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git


    from f8003990 EMPIREDB-483 Added SQLFormat class for optional pretty print
     new 729e25be upgrade Spring Boot version to 4.0.2 fix and configure logback logging fix employee name string concatenation
     new e74d35c2 update build and run command

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../empire-db-example-spring-boot/README.md        |  3 +-
 .../empire-db-example-spring-boot/pom.xml          | 47 ++++++++++++----------
 .../empire/samples/springboot/SampleApp.java       | 11 ++---
 .../src/main/resources/logback-spring.xml          | 12 ++++++
 4 files changed, 45 insertions(+), 28 deletions(-)
 create mode 100644 empire-db-examples/empire-db-example-spring-boot/src/main/resources/logback-spring.xml


(empire-db) 02/02: update build and run command

Posted by do...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git

commit e74d35c2730580aa409b366afc1b4e56554a4042
Author: datazuul <ra...@gmail.com>
AuthorDate: Fri Jan 30 19:12:35 2026 +0100

    update build and run command
---
 empire-db-examples/empire-db-example-spring-boot/README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/empire-db-examples/empire-db-example-spring-boot/README.md b/empire-db-examples/empire-db-example-spring-boot/README.md
index 105f4ce1..3afecb1d 100644
--- a/empire-db-examples/empire-db-example-spring-boot/README.md
+++ b/empire-db-examples/empire-db-example-spring-boot/README.md
@@ -24,8 +24,7 @@ Instead of `config.xml` all configuration can be found in `application.yml`.
 This example builds an executable JAR you can build and execute from this folder like this:
 
 ```sh
-$ mvn clean install
-$ java -jar target/empire-db-example-spring-boot-3.0.0-SNAPSHOT.jar
+$ mvn clean spring-boot:run
 ```
 
 An embedded hsqldb is used by default.
\ No newline at end of file


(empire-db) 01/02: upgrade Spring Boot version to 4.0.2 fix and configure logback logging fix employee name string concatenation

Posted by do...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git

commit 729e25be71cf0736eca286e50a555b07421e775e
Author: datazuul <ra...@gmail.com>
AuthorDate: Fri Jan 30 19:10:54 2026 +0100

    upgrade Spring Boot version to 4.0.2
    fix and configure logback logging
    fix employee name string concatenation
---
 .../empire-db-example-spring-boot/pom.xml          | 47 ++++++++++++----------
 .../empire/samples/springboot/SampleApp.java       | 11 ++---
 .../src/main/resources/logback-spring.xml          | 12 ++++++
 3 files changed, 44 insertions(+), 26 deletions(-)

diff --git a/empire-db-examples/empire-db-example-spring-boot/pom.xml b/empire-db-examples/empire-db-example-spring-boot/pom.xml
index da999a25..b23e2367 100644
--- a/empire-db-examples/empire-db-example-spring-boot/pom.xml
+++ b/empire-db-examples/empire-db-example-spring-boot/pom.xml
@@ -15,21 +15,22 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
-  
+
     <parent>
         <artifactId>empire-db-examples</artifactId>
         <groupId>org.apache.empire-db</groupId>
         <version>3.4.1-SNAPSHOT</version>
     </parent>
-  
+
     <name>Apache Empire-db Spring Boot Example</name>
     <artifactId>empire-db-example-spring-boot</artifactId>
     <packaging>jar</packaging>
 
     <properties>
-        <spring-boot.version>2.7.17</spring-boot.version>
+        <spring-boot.version>4.0.2</spring-boot.version>
     </properties>
 
     <dependencyManagement>
@@ -49,31 +50,35 @@
         <dependency>
             <groupId>org.apache.empire-db</groupId>
             <artifactId>empire-db</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter</artifactId>
             <exclusions>
-            	<exclusion>
-            		<groupId>ch.qos.logback</groupId>
-            		<artifactId>logback-classic</artifactId>
-            	</exclusion>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-reload4j</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
-
-		<!-- logging -->
-		<dependency>
-		    <groupId>org.slf4j</groupId>
-		    <artifactId>slf4j-reload4j</artifactId>
-		</dependency>
-
         <dependency>
             <groupId>org.hsqldb</groupId>
             <artifactId>hsqldb</artifactId>
             <scope>runtime</scope>
         </dependency>
-    
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>2.0.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-jdbc</artifactId>
diff --git a/empire-db-examples/empire-db-example-spring-boot/src/main/java/org/apache/empire/samples/springboot/SampleApp.java b/empire-db-examples/empire-db-example-spring-boot/src/main/java/org/apache/empire/samples/springboot/SampleApp.java
index b5a6986b..6284e553 100644
--- a/empire-db-examples/empire-db-example-spring-boot/src/main/java/org/apache/empire/samples/springboot/SampleApp.java
+++ b/empire-db-examples/empire-db-example-spring-boot/src/main/java/org/apache/empire/samples/springboot/SampleApp.java
@@ -346,15 +346,16 @@ public class SampleApp implements ApplicationRunner {
     for (DataListEntry dle : list) {
       long empId = dle.getRecordId(EMP);
       // int depId = dle.getId(DEP);
-      String empName = StringUtils.concat(", ", dle.getString(EMP.LAST_NAME), dle.getString(EMP.FIRST_NAME));
+      // Put the comma between last and first name (Last, First)
+      String empName = StringUtils.concat(dle.getString(EMP.LAST_NAME), ", ", dle.getString(EMP.FIRST_NAME));
       String depName = dle.getString(DEP.NAME);
       boolean hasPayments = !dle.isNull(Q_EMP_TOTAL.column(EMP_TOTAL));
       if (hasPayments) {   // report
         BigDecimal empTotal = dle.getDecimal(Q_EMP_TOTAL.column(EMP_TOTAL));
         BigDecimal pctOfDep = dle.getDecimal(PCT_OF_DEP_COST).setScale(1, RoundingMode.HALF_UP);
-        LOGGER.info("Eployee[{}]: {}\tDepartment: {}\tPayments: {} ({}% of Department)", empId, empName, depName, empTotal, pctOfDep);
+        LOGGER.info("Employee[{}]: {}\tDepartment: {}\tPayments: {} ({}% of Department)", empId, empName, depName, empTotal, pctOfDep);
       } else {
-        LOGGER.info("Eployee[{}]: {}\tDepartment: {}\tPayments: [No data avaiable]", empId, empName, depName);
+        LOGGER.info("Employee[{}]: {}\tDepartment: {}\tPayments: [No data avaiable]", empId, empName, depName);
       }
     }
 
@@ -517,10 +518,10 @@ public class SampleApp implements ApplicationRunner {
     for (DBRecordBean record : list) {
       Object[] key = record.getKey();
       // print info
-      String empName = StringUtils.concat(", ", record.getString(EMP.LAST_NAME), record.getString(EMP.FIRST_NAME));
+      String empName = StringUtils.concat(record.getString(EMP.LAST_NAME), ", ", record.getString(EMP.FIRST_NAME));
       String phone = record.getString(EMP.PHONE_NUMBER);
       BigDecimal salary = record.getDecimal(EMP.SALARY);
-      LOGGER.info("Eployee[{}]: {}\tPhone: {}\tSalary: {}", StringUtils.toString(key), empName, phone, salary);
+      LOGGER.info("Employee[{}]: {}\tPhone: {}\tSalary: {}", StringUtils.toString(key), empName, phone, salary);
       // modify salary
       BigDecimal newSalary = new BigDecimal(2000 + ((Math.random() * 200) - 100.0));
       record.set(EMP.SALARY, newSalary);
diff --git a/empire-db-examples/empire-db-example-spring-boot/src/main/resources/logback-spring.xml b/empire-db-examples/empire-db-example-spring-boot/src/main/resources/logback-spring.xml
new file mode 100644
index 00000000..f732ae06
--- /dev/null
+++ b/empire-db-examples/empire-db-example-spring-boot/src/main/resources/logback-spring.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="true">
+    <appender name="default" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>[%d{ISO8601} %5p] %40.40c:%4L [%-8t] - %m%n</pattern>
+        </encoder>
+    </appender>
+
+    <root level="info">
+        <appender-ref ref="default"/>
+    </root>
+</configuration>