From 44ee411952786a4a749a4b089e76c7d68b1f42f6 Mon Sep 17 00:00:00 2001 From: Eduardo Martins Date: Wed, 30 Oct 2024 19:28:07 +0000 Subject: [PATCH] [WFLY-19790] Replaces -ds.xml deprecated filed with Jakarta's DataSourceDefinition --- batch-processing/pom.xml | 19 +++++++++- .../as/quickstarts/batch/model/Contact.java | 8 ++++ .../WEB-INF/jboss-batch-processing-ds.xml | 38 ------------------- 3 files changed, 25 insertions(+), 40 deletions(-) delete mode 100644 batch-processing/src/main/webapp/WEB-INF/jboss-batch-processing-ds.xml diff --git a/batch-processing/pom.xml b/batch-processing/pom.xml index 7045419b84..9e62901139 100644 --- a/batch-processing/pom.xml +++ b/batch-processing/pom.xml @@ -191,6 +191,19 @@ + + + org.apache.maven.plugins + maven-war-plugin + + + + com.h2database.h2 + + + + + @@ -205,8 +218,9 @@ ${version.server} - h2-database:default + h2-database + false @@ -232,8 +246,9 @@ ${version.server} cloud - h2-database:default + h2-database + false diff --git a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/model/Contact.java b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/model/Contact.java index 41efad1b0c..1ab2b6b166 100644 --- a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/model/Contact.java +++ b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/model/Contact.java @@ -16,12 +16,20 @@ */ package org.jboss.as.quickstarts.batch.model; +import jakarta.annotation.sql.DataSourceDefinition; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.validation.constraints.NotNull; + @Entity +@DataSourceDefinition(name="java:jboss/datasources/batch-processingDS", + className="org.h2.jdbcx.JdbcDataSource", + url="jdbc:h2:mem:batch-processing;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1", + user="sa", + password="sa" +) public class Contact { @Id diff --git a/batch-processing/src/main/webapp/WEB-INF/jboss-batch-processing-ds.xml b/batch-processing/src/main/webapp/WEB-INF/jboss-batch-processing-ds.xml deleted file mode 100644 index fb23f37023..0000000000 --- a/batch-processing/src/main/webapp/WEB-INF/jboss-batch-processing-ds.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - jdbc:h2:mem:batch-processing;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1 - h2 - - sa - sa - - - -