From 3bf4f85ab712614bb254ad6e1761411f5c26b084 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 | 14 +++++++ .../as/quickstarts/batch/model/Contact.java | 8 ++++ .../WEB-INF/jboss-batch-processing-ds.xml | 38 ------------------- 3 files changed, 22 insertions(+), 38 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..9b42f53356 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 + + + + + @@ -207,6 +220,7 @@ h2-database:default + 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 - - - -