| <!DOCTYPE html> |
| <html lang="en"> |
| |
| <head> |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <title>Apache TomEE</title> |
| <meta name="description" |
| content="Apache TomEE is a lightweight, yet powerful, JavaEE Application server with feature rich tooling." /> |
| <meta name="keywords" content="tomee,asf,apache,javaee,jee,shade,embedded,test,junit,applicationcomposer,maven,arquillian" /> |
| <meta name="author" content="Luka Cvetinovic for Codrops" /> |
| <link rel="icon" href="../../favicon.ico"> |
| <link rel="icon" type="image/png" href="../../favicon.png"> |
| <meta name="msapplication-TileColor" content="#80287a"> |
| <meta name="theme-color" content="#80287a"> |
| <link rel="stylesheet" type="text/css" href="../../css/normalize.css"> |
| <link rel="stylesheet" type="text/css" href="../../css/bootstrap.css"> |
| <link rel="stylesheet" type="text/css" href="../../css/owl.css"> |
| <link rel="stylesheet" type="text/css" href="../../css/animate.css"> |
| <link rel="stylesheet" type="text/css" href="../../fonts/font-awesome-4.1.0/css/font-awesome.min.css"> |
| <link rel="stylesheet" type="text/css" href="../../fonts/eleganticons/et-icons.css"> |
| <link rel="stylesheet" type="text/css" href="../../css/jqtree.css"> |
| <link rel="stylesheet" type="text/css" href="../../css/idea.css"> |
| <link rel="stylesheet" type="text/css" href="../../css/cardio.css"> |
| |
| <script type="text/javascript"> |
| <!-- Matomo --> |
| var _paq = window._paq = window._paq || []; |
| /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ |
| /* We explicitly disable cookie tracking to avoid privacy issues */ |
| _paq.push(['disableCookies']); |
| _paq.push(['trackPageView']); |
| _paq.push(['enableLinkTracking']); |
| (function () { |
| var u = "//matomo.privacy.apache.org/"; |
| _paq.push(['setTrackerUrl', u + 'matomo.php']); |
| _paq.push(['setSiteId', '5']); |
| var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; |
| g.async = true; |
| g.src = u + 'matomo.js'; |
| s.parentNode.insertBefore(g, s); |
| })(); |
| <!-- End Matomo Code --> |
| </script> |
| </head> |
| |
| <body> |
| <div class="preloader"> |
| <img src="../../img/loader.gif" alt="Preloader image"> |
| </div> |
| <nav class="navbar"> |
| <div class="container"> |
| <div class="row"> <div class="col-md-12"> |
| |
| <!-- Brand and toggle get grouped for better mobile display --> |
| <div class="navbar-header"> |
| <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| <a class="navbar-brand" href="/" title="Apache TomEE"> |
| <span> |
| |
| |
| <img |
| src="../../img/apache_tomee-logo.svg" |
| onerror="this.src='../../img/apache_tomee-logo.jpg'" |
| height="50" |
| > |
| |
| |
| </span> |
| </a> |
| </div> |
| <!-- Collect the nav links, forms, and other content for toggling --> |
| <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| <ul class="nav navbar-nav navbar-right main-nav"> |
| <li><a href="../../docs.html">Documentation</a></li> |
| <li><a href="../../community/index.html">Community</a></li> |
| <li><a href="../../security/security.html">Security</a></li> |
| <li><a class="btn btn-accent accent-orange no-shadow" href="../../download.html">Downloads</a></li> |
| </ul> |
| </div> |
| <!-- /.navbar-collapse --> |
| </div></div> |
| </div> |
| <!-- /.container-fluid --> |
| </nav> |
| |
| |
| <div id="main-block" class="container main-block"> |
| <div class="row title"> |
| <div class="col-md-12"> |
| <div class='page-header'> |
| |
| <h1>JPA Hibernate</h1> |
| </div> |
| </div> |
| </div> |
| <div class="row"> |
| |
| <div class="col-md-12"> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>This example shows the persist, remove and creation a query in JPA Hibernate. |
| The Java Persistence API (JPA) is a Java specification for accessing, persisting, and managing data between Java objects / classes and a relational database.</p> |
| </div> |
| <div class="paragraph"> |
| <p>To exemplify the use of JPA, we will persist an Object (Movie) in the database.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Links to the documentation have been added in key parts of the example for the case of doubts and as a way to encourage their reading for details.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_movie">Movie</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Here we have a class with some details. See the annotation |
| <a href="https://tomee.apache.org/tomee-9.0/javadoc/jakarta/persistence/Entity.html">@Entity</a> |
| above the declaration, with it we are saying that this class is an entity (a table in the database). We still have two more annotations above the attribute id, one of them is |
| <a href="https://tomee.apache.org/tomee-9.0/javadoc/jakarta/persistence/Id.html">@Id</a> |
| annotation, it indicates that this attribute is the identifier of the entity and the other annotation |
| <a href="https://tomee.apache.org/tomee-9.0/javadoc/jakarta/persistence/GeneratedValue.html">@GeneratedValue</a> |
| indicates that the unique identifier value generation of the entity will be managed by the persistence provider.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-java" data-lang="java">package org.superbiz.injection.h5jpa; |
| |
| import jakarta.persistence.Entity; |
| import jakarta.persistence.GeneratedValue; |
| import jakarta.persistence.GenerationType; |
| import jakarta.persistence.Id; |
| |
| @Entity |
| public class Movie { |
| |
| @Id |
| @GeneratedValue(strategy = GenerationType.AUTO) |
| private long id; |
| |
| private String director; |
| private String title; |
| private int year; |
| |
| public Movie() { |
| } |
| |
| public Movie(String director, String title, int year) { |
| this.director = director; |
| this.title = title; |
| this.year = year; |
| } |
| |
| public String getDirector() { |
| return director; |
| } |
| |
| public void setDirector(String director) { |
| this.director = director; |
| } |
| |
| public String getTitle() { |
| return title; |
| } |
| |
| public void setTitle(String title) { |
| this.title = title; |
| } |
| |
| public int getYear() { |
| return year; |
| } |
| |
| public void setYear(int year) { |
| this.year = year; |
| } |
| |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_movies">Movies</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Now we have two important things: |
| <a href="https://tomee.apache.org/tomee-8.0/javadoc/javax/persistence/PersistenceContext.html">@PersistenceContext</a> |
| annotation and the |
| <a href="https://tomee.apache.org/tomee-8.0/javadoc/javax/persistence/EntityManager.html">EntityManager</a> |
| declaration. |
| The |
| <a href="https://tomee.apache.org/tomee-8.0/javadoc/javax/persistence/EntityManager.html">EntityManager</a> |
| is the interface with the core methods of JPA like persist, remove, merge, find and others…​ |
| We annotate the |
| <a href="https://tomee.apache.org/tomee-8.0/javadoc/javax/persistence/EntityManager.html">EntityManager</a> |
| with |
| <a href="https://tomee.apache.org/tomee-8.0/javadoc/javax/persistence/PersistenceContext.html">@PersistenceContext</a>, a persistence context is an entity management where every persistence context associated with a persistence unit, we will create a persistence.xml soon for this.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-java" data-lang="java">package org.superbiz.injection.h5jpa; |
| |
| import jakarta.ejb.Stateful; |
| import jakarta.persistence.EntityManager; |
| import jakarta.persistence.PersistenceContext; |
| import jakarta.persistence.PersistenceContextType; |
| import jakarta.persistence.Query; |
| import java.util.List; |
| |
| @Stateful |
| public class Movies { |
| |
| @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED) |
| private EntityManager entityManager; |
| |
| public void addMovie(Movie movie) throws Exception { |
| entityManager.persist(movie); |
| } |
| |
| public void deleteMovie(Movie movie) throws Exception { |
| entityManager.remove(movie); |
| } |
| |
| public List<Movie> getMovies() throws Exception { |
| Query query = entityManager.createQuery("SELECT m from Movie as m"); |
| return query.getResultList(); |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_persistence_xml">persistence.xml</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Here we define which database will persist our movies, and we perform other configurations such as: define a persistence-unit with the name movie-unit, followed by the definition of the JPA provider/implementation (in this case Hibernate) and we set some properties for hibernate. |
| Note, that we are using application composers in our test, so we do not need it in it’s xml representation.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><persistence xmlns="https://jakarta.ee/xml/ns/persistence" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" |
| version="3.0"> |
| <persistence-unit name="movie-unit"> |
| <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> |
| <jta-data-source>movieDatabase</jta-data-source> |
| <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source> |
| <properties> |
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/> |
| <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/> |
| <property name="tomee.jpa.cdi" value="false"/> |
| </properties> |
| </persistence-unit> |
| </persistence></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_moviestest">MoviesTest</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Now we do a test, persisting three films, then we perform a search and finally we delete them.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-java" data-lang="java">package org.superbiz.injection.h5jpa; |
| |
| import jakarta.inject.Inject; |
| import org.apache.openejb.jee.EjbJar; |
| import org.apache.openejb.jee.jpa.unit.PersistenceUnit; |
| import org.apache.openejb.junit.ApplicationComposer; |
| import org.apache.openejb.testing.Classes; |
| import org.apache.openejb.testing.Configuration; |
| import org.apache.openejb.testing.Module; |
| import org.junit.Test; |
| import org.junit.runner.RunWith; |
| |
| import java.util.List; |
| import java.util.Properties; |
| |
| import static org.junit.Assert.assertEquals; |
| |
| @RunWith(ApplicationComposer.class) |
| public class MoviesTest { |
| |
| @Inject |
| private Movies movies; |
| |
| @Module |
| public PersistenceUnit persistence() { |
| PersistenceUnit unit = new PersistenceUnit("movie-unit"); |
| unit.setJtaDataSource("movieDatabase"); |
| unit.setNonJtaDataSource("movieDatabaseUnmanaged"); |
| unit.getClazz().add(Movie.class.getName()); |
| unit.setProvider("org.hibernate.jpa.HibernatePersistenceProvider"); |
| unit.setProperty("hibernate.hbm2ddl.auto", "create-drop"); |
| unit.setProperty("tomee.jpa.cdi", "false"); |
| return unit; |
| } |
| |
| @Module |
| @Classes(cdi = true, value = Movies.class) |
| public EjbJar beans() { |
| EjbJar ejbJar = new EjbJar("movie-beans"); |
| return ejbJar; |
| } |
| |
| @Configuration |
| public Properties config() throws Exception { |
| Properties p = new Properties(); |
| p.put("movieDatabase", "new://Resource?type=DataSource"); |
| p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver"); |
| p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb"); |
| return p; |
| } |
| |
| @Test |
| public void test() throws Exception { |
| movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992)); |
| movies.addMovie(new Movie("Joel Coen", "Fargo", 1996)); |
| movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998)); |
| |
| List<Movie> list = movies.getMovies(); |
| assertEquals("List.size()", 3, list.size()); |
| |
| for (Movie movie : list) { |
| movies.deleteMovie(movie); |
| } |
| |
| assertEquals("Movies.getMovies()", 0, movies.getMovies().size()); |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_running">Running</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>To run the example via maven:</p> |
| </div> |
| <div class="paragraph"> |
| <p>Access the project folder:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-bash" data-lang="bash">cd jpa-hibernate</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>And execute:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-bash" data-lang="bash">mvn clean install</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Which will generate output similar to the following:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-console" data-lang="console">------------------------------------------------------- |
| T E S T S |
| ------------------------------------------------------- |
| Running org.superbiz.injection.h5jpa.MoviesTest |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@176d53b2 |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Succeeded in installing singleton service |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Cannot find the configuration file [conf/openejb.xml]. Will attempt to create one for the beans deployed. |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Creating TransactionManager(id=Default Transaction Manager) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Creating SecurityService(id=Default Security Service) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Creating Resource(id=movieDatabase) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring enterprise application: /home/zowallar/Dokumente/work/coding/tomee/examples/jpa-hibernate/MoviesTest |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Auto-deploying ejb Movies: EjbDeployment(deployment-id=Movies) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Auto-creating a container for bean org.superbiz.injection.h5jpa.MoviesTest: Container(type=MANAGED, id=Default Managed Container) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Creating Container(id=Default Managed Container) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Using directory /tmp for stateful session passivation |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Auto-creating a container for bean Movies: Container(type=STATEFUL, id=Default Stateful Container) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Creating Container(id=Default Stateful Container) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Using directory /tmp for stateful session passivation |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring PersistenceUnit(name=movie-unit, provider=org.hibernate.jpa.HibernatePersistenceProvider) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource' for 'movie-unit'. |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Configuring Service(id=movieDatabaseNonJta, type=Resource, provider-id=movieDatabase) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Creating Resource(id=movieDatabaseNonJta) |
| März 24, 2022 9:34:39 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged' |
| März 24, 2022 9:34:40 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Enterprise application "/home/zowallar/Dokumente/work/coding/tomee/examples/jpa-hibernate/MoviesTest" loaded. |
| März 24, 2022 9:34:40 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Not creating another application classloader for MoviesTest |
| März 24, 2022 9:34:40 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Assembling app: /home/zowallar/Dokumente/work/coding/tomee/examples/jpa-hibernate/MoviesTest |
| März 24, 2022 9:34:40 VORM. org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation |
| INFO: HHH000204: Processing PersistenceUnitInfo [name: movie-unit] |
| März 24, 2022 9:34:40 VORM. org.hibernate.Version logVersion |
| INFO: HHH000412: Hibernate ORM core version 5.6.7.Final |
| März 24, 2022 9:34:40 VORM. org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit> |
| INFO: HCANN000001: Hibernate Commons Annotations {5.1.2.Final} |
| März 24, 2022 9:34:40 VORM. org.hibernate.dialect.Dialect <init> |
| INFO: HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect |
| März 24, 2022 9:34:40 VORM. org.hibernate.resource.beans.spi.ManagedBeanRegistryInitiator resolveBeanContainer |
| INFO: HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader. |
| März 24, 2022 9:34:40 VORM. org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService |
| INFO: HHH000490: Using JtaPlatform implementation: [org.apache.openejb.hibernate.OpenEJBJtaPlatform2] |
| März 24, 2022 9:34:40 VORM. org.hibernate.validator.internal.util.Version <clinit> |
| INFO: HV000001: Hibernate Validator 7.0.4.Final |
| März 24, 2022 9:34:41 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: PersistenceUnit(name=movie-unit, provider=org.hibernate.jpa.HibernatePersistenceProvider) - provider time 1292ms |
| WARNING: An illegal reflective access operation has occurred |
| WARNING: Illegal reflective access by org.apache.openejb.util.proxy.ClassDefiner (file:/home/zowallar/.m2/repository/org/apache/tomee/openejb-core/9.0.0-M8-SNAPSHOT/openejb-core-9.0.0-M8-SNAPSHOT.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) |
| WARNING: Please consider reporting this to the maintainers of org.apache.openejb.util.proxy.ClassDefiner |
| WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations |
| WARNING: All illegal access operations will be denied in a future release |
| März 24, 2022 9:34:41 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Jndi(name=MoviesLocalBean) --> Ejb(deployment-id=Movies) |
| März 24, 2022 9:34:41 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Jndi(name=global/MoviesTest/movie-beans/Movies!org.superbiz.injection.h5jpa.Movies) --> Ejb(deployment-id=Movies) |
| März 24, 2022 9:34:41 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Jndi(name=global/MoviesTest/movie-beans/Movies) --> Ejb(deployment-id=Movies) |
| März 24, 2022 9:34:41 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@176d53b2 |
| März 24, 2022 9:34:41 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: OpenWebBeans Container is starting... |
| März 24, 2022 9:34:41 VORM. org.apache.webbeans.plugins.PluginLoader startUp |
| INFORMATION: Adding OpenWebBeansPlugin : [CdiPlugin] |
| März 24, 2022 9:34:42 VORM. org.apache.webbeans.config.BeansDeployer validateInjectionPoints |
| INFORMATION: All injection points were validated successfully. |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: OpenWebBeans Container has started, it took 665 ms. |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container) |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container) |
| März 24, 2022 9:34:42 VORM. org.apache.batchee.container.services.ServicesManager init |
| WARNUNG: You didn't specify org.apache.batchee.jmx.application and JMX is already registered, skipping |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Deployed Application(path=/home/zowallar/Dokumente/work/coding/tomee/examples/jpa-hibernate/MoviesTest) |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Undeploying app: /home/zowallar/Dokumente/work/coding/tomee/examples/jpa-hibernate/MoviesTest |
| März 24, 2022 9:34:42 VORM. org.hibernate.tool.schema.internal.SchemaDropperImpl$DelayedDropActionImpl perform |
| INFO: HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down' |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Closing DataSource: movieDatabase |
| März 24, 2022 9:34:42 VORM. org.apache.openejb.util.LogStreamAsync run |
| INFORMATION: Closing DataSource: movieDatabaseNonJta |
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.567 sec |
| |
| Results : |
| |
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_apis_used">APIs Used</h2> |
| <div class="sectionbody"> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="../../master/javadoc/org/apache/openejb/jee/EjbJar.html">org.apache.openejb.jee.EjbJar</a></p> |
| </li> |
| <li> |
| <p><a href="../../master/javadoc/org/apache/openejb/jee/jpa/unit/PersistenceUnit.html">org.apache.openejb.jee.jpa.unit.PersistenceUnit</a></p> |
| </li> |
| <li> |
| <p><a href="../../master/javadoc/org/apache/openejb/junit/ApplicationComposer.html">org.apache.openejb.junit.ApplicationComposer</a></p> |
| </li> |
| <li> |
| <p><a href="../../master/javadoc/org/apache/openejb/testing/Classes.html">org.apache.openejb.testing.Classes</a></p> |
| </li> |
| <li> |
| <p><a href="../../master/javadoc/org/apache/openejb/testing/Configuration.html">org.apache.openejb.testing.Configuration</a></p> |
| </li> |
| <li> |
| <p><a href="../../master/javadoc/org/apache/openejb/testing/Module.html">org.apache.openejb.testing.Module</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/ejb/Stateful.html">jakarta.ejb.Stateful</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/Entity.html">jakarta.persistence.Entity</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/EntityManager.html">jakarta.persistence.EntityManager</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/GeneratedValue.html">jakarta.persistence.GeneratedValue</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/GenerationType.html">jakarta.persistence.GenerationType</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/Id.html">jakarta.persistence.Id</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/PersistenceContext.html">jakarta.persistence.PersistenceContext</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/PersistenceContextType.html">jakarta.persistence.PersistenceContextType</a></p> |
| </li> |
| <li> |
| <p><a href="../../jakartaee-9.0/javadoc/jakarta/persistence/Query.html">jakarta.persistence.Query</a></p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| </div> |
| </div> |
| <div style="margin-bottom: 30px;"></div> |
| <footer> |
| <div class="container"> |
| <div class="row"> |
| <div class="col-sm-6 text-center-mobile"> |
| <h3 class="white">Be simple. Be certified. Be Tomcat.</h3> |
| <h5 class="light regular light-white">"A good application in a good server"</h5> |
| <ul class="social-footer"> |
| <li><a href="https://www.facebook.com/ApacheTomEE/"><i class="fa fa-facebook"></i></a></li> |
| <li><a href="https://twitter.com/apachetomee"><i class="fa fa-twitter"></i></a></li> |
| </ul> |
| <h5 class="light regular light-white"> |
| <a href="../../privacy-policy.html" class="white">Privacy Policy</a> |
| </h5> |
| </div> |
| <div class="col-sm-6 text-center-mobile"> |
| <div class="row opening-hours"> |
| <div class="col-sm-3 text-center-mobile"> |
| <h5><a href="../../latest/docs/" class="white">Documentation</a></h5> |
| <ul class="list-unstyled"> |
| <li><a href="../../latest/docs/admin/configuration/index.html" class="regular light-white">How to configure</a></li> |
| <li><a href="../../latest/docs/admin/file-layout.html" class="regular light-white">Dir. Structure</a></li> |
| <li><a href="../../latest/docs/developer/testing/index.html" class="regular light-white">Testing</a></li> |
| <li><a href="../../latest/docs/admin/cluster/index.html" class="regular light-white">Clustering</a></li> |
| </ul> |
| </div> |
| <div class="col-sm-3 text-center-mobile"> |
| <h5><a href="../../latest/examples/" class="white">Examples</a></h5> |
| <ul class="list-unstyled"> |
| <li><a href="../../latest/examples/simple-cdi-interceptor.html" class="regular light-white">CDI Interceptor</a></li> |
| <li><a href="../../latest/examples/rest-cdi.html" class="regular light-white">REST with CDI</a></li> |
| <li><a href="../../latest/examples/ejb-examples.html" class="regular light-white">EJB</a></li> |
| <li><a href="../../latest/examples/jsf-managedBean-and-ejb.html" class="regular light-white">JSF</a></li> |
| </ul> |
| </div> |
| <div class="col-sm-3 text-center-mobile"> |
| <h5><a href="../../community/index.html" class="white">Community</a></h5> |
| <ul class="list-unstyled"> |
| <li><a href="../../community/contributors.html" class="regular light-white">Contributors</a></li> |
| <li><a href="../../community/social.html" class="regular light-white">Social</a></li> |
| <li><a href="../../community/sources.html" class="regular light-white">Sources</a></li> |
| </ul> |
| </div> |
| <div class="col-sm-3 text-center-mobile"> |
| <h5><a href="../../security/index.html" class="white">Security</a></h5> |
| <ul class="list-unstyled"> |
| <li><a href="https://apache.org/security" target="_blank" class="regular light-white">Apache Security</a></li> |
| <li><a href="https://apache.org/security/projects.html" target="_blank" class="regular light-white">Security Projects</a></li> |
| <li><a href="https://cve.mitre.org" target="_blank" class="regular light-white">CVE</a></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="row bottom-footer text-center-mobile"> |
| <div class="col-sm-12 light-white"> |
| <p>Copyright © 1999-2022 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache TomEE, TomEE, Apache, the Apache feather logo, and the Apache TomEE project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.</p> |
| </div> |
| </div> |
| </div> |
| </footer> |
| <!-- Holder for mobile navigation --> |
| <div class="mobile-nav"> |
| <ul> |
| <li><a hef="../../latest/docs/admin/index.html">Administrators</a> |
| <li><a hef="../../latest/docs/developer/index.html">Developers</a> |
| <li><a hef="../../latest/docs/advanced/index.html">Advanced</a> |
| <li><a hef="../../community/index.html">Community</a> |
| </ul> |
| <a href="#" class="close-link"><i class="arrow_up"></i></a> |
| </div> |
| <!-- Scripts --> |
| <script src="../../js/jquery-1.11.1.min.js"></script> |
| <script src="../../js/owl.carousel.min.js"></script> |
| <script src="../../js/bootstrap.min.js"></script> |
| <script src="../../js/wow.min.js"></script> |
| <script src="../../js/typewriter.js"></script> |
| <script src="../../js/jquery.onepagenav.js"></script> |
| <script src="../../js/tree.jquery.js"></script> |
| <script src="../../js/highlight.pack.js"></script> |
| <script src="../../js/main.js"></script> |
| </body> |
| |
| </html> |
| |