This commit is contained in:
Jonathan Cook
2019-10-23 15:01:44 +02:00
parent db85c8f275
commit 684ec0d2e3
20486 changed files with 1642483 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
<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>
@@ -0,0 +1,24 @@
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();
}
}
@@ -0,0 +1,13 @@
<?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>