java-18762: remove unused wildfly modules (#14632)
This commit is contained in:
parent
d7c57a2e2b
commit
f1cb122104
|
@ -16,11 +16,6 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>widlfly-web</module>
|
|
||||||
<module>wildfly-ear</module>
|
|
||||||
<module>wildfly-jpa</module>
|
|
||||||
<module>wildfly-ejb-interfaces</module>
|
|
||||||
<module>wildfly-ejb</module>
|
|
||||||
<module>wildfly-mdb</module>
|
<module>wildfly-mdb</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>widlfly-web</artifactId>
|
|
||||||
<name>widlfly-web</name>
|
|
||||||
<packaging>war</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- Dependency for java ee -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax</groupId>
|
|
||||||
<artifactId>javaee-api</artifactId>
|
|
||||||
<version>${javaee-api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for JPA module -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-jpa</artifactId>
|
|
||||||
<version>${wildlfy.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for EJB interface module -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-ejb-interfaces</artifactId>
|
|
||||||
<version>${wildlfy.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for EJB interface module -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-ejb</artifactId>
|
|
||||||
<version>${wildlfy.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
|
|
||||||
</properties>
|
|
||||||
</project>
|
|
|
@ -1,41 +0,0 @@
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.EJB;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServlet;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import model.User;
|
|
||||||
import wildfly.beans.UserBeanLocal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Servlet implementation class TestEJBServlet
|
|
||||||
*/
|
|
||||||
public class TestEJBServlet extends HttpServlet {
|
|
||||||
|
|
||||||
@EJB
|
|
||||||
private UserBeanLocal userBean;
|
|
||||||
|
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
||||||
List<User> users = userBean.getUsers();
|
|
||||||
|
|
||||||
PrintWriter out = response.getWriter();
|
|
||||||
|
|
||||||
out.println("<html>");
|
|
||||||
out.println("<body>");
|
|
||||||
for (User user : users) {
|
|
||||||
out.print(user.getUsername());
|
|
||||||
out.print(" " + user.getEmail() + " <br>");
|
|
||||||
}
|
|
||||||
out.println("</body>");
|
|
||||||
out.println("</html>");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
||||||
doGet(request, response);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.persistence.EntityManager;
|
|
||||||
import javax.persistence.PersistenceContext;
|
|
||||||
import javax.persistence.Query;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServlet;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.transaction.UserTransaction;
|
|
||||||
|
|
||||||
import model.User;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Servlet implementation class TestJPAServlet
|
|
||||||
*/
|
|
||||||
public class TestJPAServlet extends HttpServlet {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
@PersistenceContext(unitName = "wildfly-jpa")
|
|
||||||
EntityManager em;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
UserTransaction tx;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see HttpServlet#HttpServlet()
|
|
||||||
*/
|
|
||||||
public TestJPAServlet() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
|
||||||
*/
|
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
||||||
Query q = em.createNamedQuery("User.findAll");
|
|
||||||
List<User> users = q.getResultList();
|
|
||||||
response.getWriter()
|
|
||||||
.append("JPA users returned: " + users.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
|
||||||
*/
|
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
doGet(request, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration>
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
|
||||||
</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
|
||||||
version="2.5">
|
|
||||||
<display-name>widlfly-web</display-name>
|
|
||||||
<welcome-file-list>
|
|
||||||
<welcome-file>index.html</welcome-file>
|
|
||||||
<welcome-file>index.htm</welcome-file>
|
|
||||||
<welcome-file>index.jsp</welcome-file>
|
|
||||||
<welcome-file>default.html</welcome-file>
|
|
||||||
<welcome-file>default.htm</welcome-file>
|
|
||||||
<welcome-file>default.jsp</welcome-file>
|
|
||||||
</welcome-file-list>
|
|
||||||
<servlet>
|
|
||||||
<description></description>
|
|
||||||
<display-name>TestJPAServlet</display-name>
|
|
||||||
<servlet-name>TestJPAServlet</servlet-name>
|
|
||||||
<servlet-class>TestJPAServlet</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>TestJPAServlet</servlet-name>
|
|
||||||
<url-pattern>/TestJPAServlet</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
<servlet>
|
|
||||||
<description></description>
|
|
||||||
<display-name>TestEJBServlet</display-name>
|
|
||||||
<servlet-name>TestEJBServlet</servlet-name>
|
|
||||||
<servlet-class>TestEJBServlet</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>TestEJBServlet</servlet-name>
|
|
||||||
<url-pattern>/TestEJBServlet</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
</web-app>
|
|
|
@ -1,73 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>wildfly-ear</artifactId>
|
|
||||||
<name>wildfly-ear</name>
|
|
||||||
<packaging>ear</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- Dependency for web module -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>widlfly-web</artifactId>
|
|
||||||
<version>${wildlfy.version}</version>
|
|
||||||
<type>war</type>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for web module -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-jpa</artifactId>
|
|
||||||
<version>${wildlfy.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for EJB -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-ejb</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for EJB -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-ejb-interfaces</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-ear-plugin</artifactId>
|
|
||||||
<version>${maven-ear-plugin.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<defaultLibBundleDir>lib/</defaultLibBundleDir>
|
|
||||||
<version>${defaultLibBundleDir.version}</version>
|
|
||||||
<modules>
|
|
||||||
<webModule>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>widlfly-web</artifactId>
|
|
||||||
<contextRoot>/wildfly</contextRoot>
|
|
||||||
</webModule>
|
|
||||||
</modules>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
<version>${wildfly-maven-plugin.version}</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven-ear-plugin.version>2.10.1</maven-ear-plugin.version>
|
|
||||||
<wildfly-maven-plugin.version>1.2.0.Final</wildfly-maven-plugin.version>
|
|
||||||
<defaultLibBundleDir.version>7</defaultLibBundleDir.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>wildfly-ejb-interfaces</artifactId>
|
|
||||||
<name>wildfly-ejb-interfaces</name>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- Dependency for EJB javax -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.ejb</groupId>
|
|
||||||
<artifactId>javax.ejb-api</artifactId>
|
|
||||||
<version>${javax.ejb-api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for JPA module -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-jpa</artifactId>
|
|
||||||
<version>${wildlfy.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<javax.ejb-api.version>3.2</javax.ejb-api.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,13 +0,0 @@
|
||||||
package wildfly.beans;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.Local;
|
|
||||||
|
|
||||||
import model.User;
|
|
||||||
|
|
||||||
@Local
|
|
||||||
public interface UserBeanLocal {
|
|
||||||
|
|
||||||
List<User> getUsers();
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package wildfly.beans;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.Remote;
|
|
||||||
|
|
||||||
import model.User;
|
|
||||||
|
|
||||||
@Remote
|
|
||||||
public interface UserBeanRemote {
|
|
||||||
|
|
||||||
List<User> getUsers();
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration>
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
|
||||||
</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
|
@ -1,58 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>wildfly-ejb</artifactId>
|
|
||||||
<name>wildfly-ejb</name>
|
|
||||||
<packaging>ejb</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- Dependency for EJB javax -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.ejb</groupId>
|
|
||||||
<artifactId>javax.ejb-api</artifactId>
|
|
||||||
<version>${ejb.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for java ee -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax</groupId>
|
|
||||||
<artifactId>javaee-api</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for JPA -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Dependency for EJB Local and Remote -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly-ejb-interfaces</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-ejb-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<ejbVersion>${ejb.version}</ejbVersion>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<ejb.version>3.2</ejb.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,24 +0,0 @@
|
||||||
package wildfly.beans;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ejb.Stateless;
|
|
||||||
import javax.persistence.EntityManager;
|
|
||||||
import javax.persistence.PersistenceContext;
|
|
||||||
|
|
||||||
import model.User;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Session Bean implementation class UserBean
|
|
||||||
*/
|
|
||||||
@Stateless
|
|
||||||
public class UserBean implements UserBeanRemote, UserBeanLocal {
|
|
||||||
@PersistenceContext(unitName = "wildfly-jpa")
|
|
||||||
private EntityManager em;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<User> getUsers() {
|
|
||||||
return em.createNamedQuery("User.findAll")
|
|
||||||
.getResultList();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration>
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
|
||||||
</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
|
@ -1,25 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>wildfly-jpa</artifactId>
|
|
||||||
<name>wildfly-jpa</name>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.baeldung.wildfly</groupId>
|
|
||||||
<artifactId>wildfly</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- Dependencies for other libraries -->
|
|
||||||
<!-- Dependency for JPA -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-core</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,51 +0,0 @@
|
||||||
package model;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The persistent class for the users database table.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Entity
|
|
||||||
@Table(name = "users")
|
|
||||||
@NamedQuery(name = "User.findAll", query = "SELECT u FROM User u")
|
|
||||||
public class User implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
@Column(name = "postal_number")
|
|
||||||
private Integer postalNumber;
|
|
||||||
|
|
||||||
public User() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUsername() {
|
|
||||||
return this.username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEmail() {
|
|
||||||
return this.email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmail(String email) {
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPostalNumber() {
|
|
||||||
return this.postalNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostalNumber(Integer postalNumber) {
|
|
||||||
this.postalNumber = postalNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<persistence version="2.1"
|
|
||||||
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
|
|
||||||
<persistence-unit name="wildfly-jpa" transaction-type="JTA">
|
|
||||||
<jta-data-source>java:/H2DS</jta-data-source>
|
|
||||||
<class>model.User</class>
|
|
||||||
<properties>
|
|
||||||
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
|
|
||||||
<property name="hibernate.show_sql" value="true" />
|
|
||||||
<property name="hibernate.hbm2ddl.auto" value="create" />
|
|
||||||
<property name="hibernate.hbm2ddl.import_files" value="data.sql" />
|
|
||||||
</properties>
|
|
||||||
</persistence-unit>
|
|
||||||
</persistence>
|
|
|
@ -1 +0,0 @@
|
||||||
INSERT INTO users (username, email, postal_number) VALUES ('user1', 'user1@baeldung.com', 1000), ('user2', 'user2@baeldung.com', 2);
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration>
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
|
||||||
</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
Loading…
Reference in New Issue