You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2019/01/05 07:51:30 UTC
svn commit: r1850466 [6/9] - in /tomee/site/trunk/content: ./ blog/
blog/2016/03/ blog/2017/ community/ community/contributing/ security/ tags/
tomee-8.0/ tomee-8.0/docs/ tomee-8.0/docs/admin/
tomee-8.0/docs/admin/cluster/ tomee-8.0/docs/admin/configur...
Modified: tomee/site/trunk/content/tomee-8.0/examples/index.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/index.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/index.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/index.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
@@ -93,19 +93,6 @@
</div>
<div class="row">
<div class="col-md-4">
- <div class="group-title">CDI</div>
- <ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-application-scope.html">CDI @ApplicationScoped</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-basic.html">CDI @Inject</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-request-scope.html">CDI @RequestScoped</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-events.html">CDI Events - Loose Coupling and Extensibility</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-produces-field.html">CDI Field Producer</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-interceptors.html">CDI Interceptors</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-produces-disposes.html">CDI Produces Disposes</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-cdi-interceptor.html">Simple CDI Interceptor</a></li>
- </ul>
- </div>
- <div class="col-md-4">
<div class="group-title">Web Services</div>
<ul class="group">
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="webservice-handlerchain.html">@WebService handlers with @HandlerChain</a></li>
@@ -119,6 +106,17 @@
</ul>
</div>
<div class="col-md-4">
+ <div class="group-title">JPA</div>
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-entitymanager.html">Injection Of Entitymanager</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jpa-enumerated.html">JPA and Enums via @Enumerated</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jpa-eclipselink.html">JPA Eclipselink</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jpa-hibernate.html">JPA Hibernate</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="multi-jpa-provider-testing.html">Multiple JPA Providers Test</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="persistence-fragment.html">Persistence Fragment</a></li>
+ </ul>
+ </div>
+ <div class="col-md-4">
<div class="group-title">EJB</div>
<ul class="group">
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="access-timeout.html">@AccessTimeout Annotation</a></li>
@@ -152,18 +150,6 @@
</ul>
</div>
<div class="col-md-4">
- <div class="group-title">Unknown</div>
- <ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-alternative-and-stereotypes.html">cdi-alternative-and-stereotypes</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-session-scope.html">cdi-session-scope</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="connector-war.html">connector-war</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="decorators.html">decorators</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="java-modules.html">Java modules example with a simple REST resource</a></li>
- </ul>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
<div class="group-title">Meta-Annotations</div>
<ul class="group">
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="access-timeout-meta.html">@AccessTimeout the Meta-Annotation Way</a></li>
@@ -173,6 +159,8 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="testing-security-meta.html">Testing Security Meta</a></li>
</ul>
</div>
+ </div>
+ <div class="row">
<div class="col-md-4">
<div class="group-title">Session Beans</div>
<ul class="group">
@@ -183,6 +171,15 @@
</ul>
</div>
<div class="col-md-4">
+ <div class="group-title">JMS and MDBs</div>
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-connectionfactory.html">Injection Of Connectionfactory</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-mdb.html">Simple MDB</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-mdb-and-cdi.html">Simple MDB and CDI</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-mdb-with-descriptor.html">Simple MDB with Descriptor</a></li>
+ </ul>
+ </div>
+ <div class="col-md-4">
<div class="group-title">DataSources</div>
<ul class="group">
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="datasource-ciphered-password.html">DataSource Ciphered Password</a></li>
@@ -203,15 +200,6 @@
</ul>
</div>
<div class="col-md-4">
- <div class="group-title">EntityManagers</div>
- <ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-entitymanager.html">Injection Of Entitymanager</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jpa-enumerated.html">JPA and Enums via @Enumerated</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jpa-eclipselink.html">JPA Eclipselink</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jpa-hibernate.html">JPA Hibernate</a></li>
- </ul>
- </div>
- <div class="col-md-4">
<div class="group-title">Referencing EJBs</div>
<ul class="group">
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-ejbs.html">Injection Of Ejbs</a></li>
@@ -219,8 +207,6 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="lookup-of-ejbs-with-descriptor.html">Lookup Of Ejbs with Descriptor</a></li>
</ul>
</div>
- </div>
- <div class="row">
<div class="col-md-4">
<div class="group-title">Security</div>
<ul class="group">
@@ -229,14 +215,8 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="testing-security-3.html">Testing Security 3</a></li>
</ul>
</div>
- <div class="col-md-4">
- <div class="group-title">JMS and MDBs</div>
- <ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-connectionfactory.html">Injection Of Connectionfactory</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-mdb.html">Simple MDB</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-mdb-with-descriptor.html">Simple MDB with Descriptor</a></li>
- </ul>
- </div>
+ </div>
+ <div class="row">
<div class="col-md-4">
<div class="group-title">Transactions</div>
<ul class="group">
@@ -245,8 +225,6 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="transaction-rollback.html">Transaction Rollback</a></li>
</ul>
</div>
- </div>
- <div class="row">
<div class="col-md-4">
<div class="group-title">Proxy Beans</div>
<ul class="group">
@@ -263,34 +241,47 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="struts.html">Struts</a></li>
</ul>
</div>
- <div class="col-md-4">
- <div class="group-title">Environment Entries</div>
- <ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="custom-injection.html">Custom Injection</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-env-entry.html">Using EnvEntries</a></li>
- </ul>
- </div>
</div>
<div class="row">
<div class="col-md-4">
- <div class="group-title">EJB Legacy</div>
+ <div class="group-title">JSON-B</div>
<ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="component-interfaces.html">Component Interfaces</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-cmp2.html">EJB 2.1 CMP EntityBeans (CMP2)</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jsonb-configuration.html">jsonb-configuration</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="jsonb-custom-serializer.html">jsonb-custom-serializer</a></li>
</ul>
</div>
<div class="col-md-4">
<div class="group-title">Java EE Connectors</div>
<ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="connector-war.html">Connectors in WAR Files</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="quartz-app.html">Quartz Resource Adapter usage</a></li>
</ul>
</div>
<div class="col-md-4">
- <div class="group-title">JPA Providers</div>
+ <div class="group-title">Unknown</div>
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="java-modules.html">Java modules example with a simple REST resource</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-remote-tomcatusers.html">simple-remote-tomcatusers</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="group-title">Environment Entries</div>
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="custom-injection.html">Custom Injection</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="injection-of-env-entry.html">Using EnvEntries</a></li>
+ </ul>
+ </div>
+ <div class="col-md-4">
+ <div class="group-title">EJB Legacy</div>
<ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="multi-jpa-provider-testing.html">Multiple JPA providers test</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="component-interfaces.html">Component Interfaces</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-cmp2.html">EJB 2.1 CMP EntityBeans (CMP2)</a></li>
</ul>
</div>
+ <div class="col-md-4">
+ </div>
</div>
<div class="row">
<div class="col-md-12">
@@ -323,6 +314,38 @@
</div>
<div class="row">
<div class="col-md-12">
+ <div class="group-title large">CDI</div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-application-scope.html">CDI @ApplicationScoped</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-basic.html">CDI @Inject</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-qualifier.html">CDI @Qualifier</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-request-scope.html">CDI @RequestScoped</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-session-scope.html">CDI @SessionScoped</a></li>
+ </ul>
+ </div>
+ <div class="col-md-4">
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-alternative-and-stereotypes.html">CDI Alternative and Stereotypes</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-events.html">CDI Events - Loose Coupling and Extensibility</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-produces-field.html">CDI Field Producer</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-interceptors.html">CDI Interceptors</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="cdi-produces-disposes.html">CDI Produces Disposes</a></li>
+ </ul>
+ </div>
+ <div class="col-md-4">
+ <ul class="group">
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="decorators.html">Decorators</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="schedule-events.html">Schedule CDI Events</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-cdi-interceptor.html">Simple CDI Interceptor</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12">
<div class="group-title large">MicroProfile</div>
</div>
</div>
@@ -333,11 +356,13 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-custom-healthcheck.html">MicroProfile Custom Health Check</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-faulttolerance-fallback.html">MicroProfile Fault Tolerance - Fallback</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-faulttolerance-retry.html">MicroProfile Fault Tolerance - Retry Policy</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-rest-jwt.html">MicroProfile JWT</a></li>
</ul>
</div>
<div class="col-md-4">
<ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-rest-jwt.html">MicroProfile JWT</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-rest-jwt-jwk.html">MicroProfile JWT JWKs</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-rest-jwt-principal.html">MicroProfile JWT Principal</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-metrics-counted.html">MicroProfile Metrics Counted</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-metrics-histogram.html">MicroProfile Metrics Histogram</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-metrics-metered.html">MicroProfile Metrics Metered</a></li>
@@ -348,6 +373,7 @@
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-metrics-timed.html">MicroProfile Metrics Timed</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-opentracing-traced.html">MicroProfile OpenTracing @Traced</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-rest-client.html">MicroProfile Rest Client</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-rest-jwt-public-key.html">MP REST JWT with Public key from MP Config</a></li>
</ul>
</div>
</div>
@@ -371,18 +397,16 @@
<div class="col-md-4">
<ul class="group">
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="javamail.html">Javamail API</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mp-jsonb-configuration.html">mp-jsonb-configuration</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="mtom.html">mtom</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="myfaces-codi-demo.html">MyFaces CODI Demo</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="persistence-fragment.html">Persistence Fragment</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="reload-persistence-unit-properties.html">Reload Persistence Unit Properties</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="schedule-events.html">Schedule CDI Events</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-mdb-and-cdi.html">Simple MDB and CDI</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="rest-xml-json.html">Simple REST</a></li>
+ <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="rest-cdi.html">Simple REST with CDI</a></li>
</ul>
</div>
<div class="col-md-4">
<ul class="group">
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="rest-xml-json.html">Simple REST</a></li>
- <li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="rest-cdi.html">Simple REST with CDI</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-stateful-callbacks.html">Simple Stateful with callback methods</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-stateless-callbacks.html">Simple Stateless with callback methods</a></li>
<li class="group-item"><span class="group-item-i" ><i class="fa fa-angle-right"></i></span><a href="simple-webservice-without-interface.html">Simple Webservice Without Interface</a></li>
Modified: tomee/site/trunk/content/tomee-8.0/examples/injection-of-connectionfactory.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/injection-of-connectionfactory.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/injection-of-connectionfactory.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/injection-of-connectionfactory.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/injection-of-datasource.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/injection-of-datasource.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/injection-of-datasource.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/injection-of-datasource.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/injection-of-ejbs.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/injection-of-ejbs.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/injection-of-ejbs.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/injection-of-ejbs.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/injection-of-entitymanager.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/injection-of-entitymanager.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/injection-of-entitymanager.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/injection-of-entitymanager.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
@@ -95,10 +95,25 @@
<div class="row">
<div class="col-md-12">
- <p>This example shows use of <code>@PersistenceContext</code> to have an <code>EntityManager</code> with an<br/><code>EXTENDED</code> persistence context injected into a <code>@Stateful bean</code>. A JPA<br/><code>@Entity</code> bean is used with the <code>EntityManager</code> to create, persist and merge<br/>data to a database.</p>
-<h2>Creating the JPA Entity</h2>
-<p>The entity itself is simply a pojo annotated with <code>@Entity</code>. We create one called <code>Movie</code> which we can use to hold movie records.</p>
-<pre><code>package org.superbiz.injection.jpa;
+ <div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>This example shows use of <code>@PersistenceContext</code> to have an <code>EntityManager</code> with an
+<code>EXTENDED</code> persistence context injected into a <code>@Stateful bean</code>. A JPA
+<code>@Entity</code> bean is used with the <code>EntityManager</code> to create, persist and merge
+data to a database.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_creating_the_jpa_entity">Creating the JPA Entity</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The entity itself is simply a pojo annotated with <code>@Entity</code>. We create one called <code>Movie</code> which we can use to hold movie records.</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.injection.jpa;
import javax.persistence.Entity;
@@ -152,28 +167,53 @@ public class Movie {
public void setYear(int year) {
this.year = year;
}
-}
-</code></pre>
-<h2>Configure the EntityManager via a persistence.xml file</h2>
-<p>The above <code>Movie</code> entity can be created, removed, updated or deleted via an <code>EntityManager</code> object. The <code>EntityManager</code> itself is configured via a <code>META-INF/persistence.xml</code> file that is placed in the same jar as the <code>Movie</code> entity.</p>
-<pre><code><persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_configure_the_entitymanager_via_a_persistence_xml_file">Configure the EntityManager via a persistence.xml file</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The above <code>Movie</code> entity can be created, removed, updated or deleted via an <code>EntityManager</code> object. The <code>EntityManager</code> itself is
+configured via a <code>META-INF/persistence.xml</code> file that is placed in the same jar as the <code>Movie</code> entity.</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre><persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
- <persistence-unit name="movie-unit">
+ <persistence-unit name="movie-unit">
<jta-data-source>movieDatabase</jta-data-source>
<non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source>
<class>org.superbiz.injection.jpa.Movie</class>
<properties>
- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
</properties>
</persistence-unit>
-</persistence>
-</code></pre>
-<p>Notice that the <code>Movie</code> entity is listed via a <code><class></code> element. This is not required, but can help when testing or when the<br/><code>Movie</code> class is located in a different jar than the jar containing the <code>persistence.xml</code> file.</p>
-<h2>Injection via @PersistenceContext</h2>
-<p>The <code>EntityManager</code> itself is created by the container using the information in the <code>persistence.xml</code>, so to use it at runtime, we simply need to request it be injected into one of our components. We do this via <code>@PersistenceContext</code></p>
-<p>The <code>@PersistenceContext</code> annotation can be used on any CDI bean, EJB, Servlet, Servlet Listener, Servlet Filter, or JSF ManagedBean. If you don't use an EJB you will need to use a <code>UserTransaction</code> begin and commit transactions manually. A transaction is required for any of the create, update or delete methods of the EntityManager to work.</p>
-<pre><code>package org.superbiz.injection.jpa;
+</persistence></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Notice that the <code>Movie</code> entity is listed via a <code><class></code> element. This is not required, but can help when testing or when the
+<code>Movie</code> class is located in a different jar than the jar containing the <code>persistence.xml</code> file.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_injection_via_persistencecontext">Injection via @PersistenceContext</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The <code>EntityManager</code> itself is created by the container using the information in the <code>persistence.xml</code>, so to use it at
+runtime, we simply need to request it be injected into one of our components. We do this via <code>@PersistenceContext</code></p>
+</div>
+<div class="paragraph">
+<p>The <code>@PersistenceContext</code> annotation can be used on any CDI bean, EJB, Servlet, Servlet Listener, Servlet Filter, or JSF ManagedBean. If you don’t use an EJB you will need to use a <code>UserTransaction</code> begin and commit transactions manually. A transaction is required for any of the create, update or delete methods of the EntityManager to work.</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.injection.jpa;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
@@ -185,7 +225,7 @@ import java.util.List;
@Stateful
public class Movies {
- @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+ @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
private EntityManager entityManager;
public void addMovie(Movie movie) throws Exception {
@@ -197,16 +237,31 @@ public class Movies {
}
public List<Movie> getMovies() throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m");
+ Query query = entityManager.createQuery("SELECT m from Movie as m");
return query.getResultList();
}
-}
-</code></pre>
-<p>This particular <code>EntityManager</code> is injected as an <code>EXTENDED</code> persistence context, which simply means that the <code>EntityManager</code> is created when the <code>@Stateful</code> bean is created and destroyed when the <code>@Stateful</code> bean is destroyed. Simply put, the data in the <code>EntityManager</code> is cached for the lifetime of the <code>@Stateful</code> bean.</p>
-<p>The use of <code>EXTENDED</code> persistence contexts is <strong>only</strong> available to <code>@Stateful</code> beans. See the <a href="../../jpa-concepts.html">JPA Concepts</a> page for an high level explanation of what a "persistence context" really is and how it is significant to JPA.</p>
-<h2>MoviesTest</h2>
+}</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>This particular <code>EntityManager</code> is injected as an <code>EXTENDED</code> persistence context, which simply means that the <code>EntityManager</code>
+is created when the <code>@Stateful</code> bean is created and destroyed when the <code>@Stateful</code> bean is destroyed. Simply put, the
+data in the <code>EntityManager</code> is cached for the lifetime of the <code>@Stateful</code> bean.</p>
+</div>
+<div class="paragraph">
+<p>The use of <code>EXTENDED</code> persistence contexts is <strong>only</strong> available to <code>@Stateful</code> beans. See the <a href="../../jpa-concepts.html">JPA Concepts</a> page for an high level explanation of what a "persistence context" really is and how it is significant to JPA.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_moviestest">MoviesTest</h2>
+<div class="sectionbody">
+<div class="paragraph">
<p>Testing JPA is quite easy, we can simply use the <code>EJBContainer</code> API to create a container in our test case.</p>
-<pre><code>package org.superbiz.injection.jpa;
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.injection.jpa;
import junit.framework.TestCase;
@@ -221,32 +276,39 @@ public class MoviesTest extends TestCase
public void test() throws Exception {
final 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");
+ p.put("movieDatabase", "new://Resource?type=DataSource");
+ p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+ p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
final Context context = EJBContainer.createEJBContainer(p).getContext();
- Movies movies = (Movies) context.lookup("java:global/injection-of-entitymanager/Movies");
+ Movies movies = (Movies) context.lookup("java:global/injection-of-entitymanager/Movies");
- 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));
+ 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());
+ assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
- assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
-}
-</code></pre>
-<h1>Running</h1>
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<h1 id="_running" class="sect0">Running</h1>
+<div class="paragraph">
<p>When we run our test case we should see output similar to the following.</p>
-<pre><code>-------------------------------------------------------
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.injection.jpa.MoviesTest
@@ -254,7 +316,7 @@ Apache OpenEJB 4.0.0-beta-1 build: 20
http://tomee.apache.org/
INFO - openejb.home = /Users/dblevins/examples/injection-of-entitymanager
INFO - openejb.base = /Users/dblevins/examples/injection-of-entitymanager
-INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
@@ -266,16 +328,16 @@ INFO - Auto-creating a container for bea
INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
INFO - Auto-creating a container for bean org.superbiz.injection.jpa.MoviesTest: Container(type=MANAGED, id=Default Managed Container)
INFO - Configuring PersistenceUnit(name=movie-unit)
-INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
+INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
INFO - Configuring Service(id=movieDatabaseNonJta, type=Resource, provider-id=movieDatabase)
-INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
-INFO - Enterprise application "/Users/dblevins/examples/injection-of-entitymanager" loaded.
+INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
+INFO - Enterprise application "/Users/dblevins/examples/injection-of-entitymanager" loaded.
INFO - Assembling app: /Users/dblevins/examples/injection-of-entitymanager
INFO - PersistenceUnit(name=movie-unit, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 462ms
-INFO - Jndi(name="java:global/injection-of-entitymanager/Movies!org.superbiz.injection.jpa.Movies")
-INFO - Jndi(name="java:global/injection-of-entitymanager/Movies")
-INFO - Jndi(name="java:global/EjbModule1461341140/org.superbiz.injection.jpa.MoviesTest!org.superbiz.injection.jpa.MoviesTest")
-INFO - Jndi(name="java:global/EjbModule1461341140/org.superbiz.injection.jpa.MoviesTest")
+INFO - Jndi(name="java:global/injection-of-entitymanager/Movies!org.superbiz.injection.jpa.Movies")
+INFO - Jndi(name="java:global/injection-of-entitymanager/Movies")
+INFO - Jndi(name="java:global/EjbModule1461341140/org.superbiz.injection.jpa.MoviesTest!org.superbiz.injection.jpa.MoviesTest")
+INFO - Jndi(name="java:global/EjbModule1461341140/org.superbiz.injection.jpa.MoviesTest")
INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
INFO - Created Ejb(deployment-id=org.superbiz.injection.jpa.MoviesTest, ejb-name=org.superbiz.injection.jpa.MoviesTest, container=Default Managed Container)
INFO - Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
@@ -285,8 +347,9 @@ Tests run: 1, Failures: 0, Errors: 0, Sk
Results :
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-</code></pre>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</pre>
+</div>
+</div>
</div>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/injection-of-env-entry.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/injection-of-env-entry.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/injection-of-env-entry.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/injection-of-env-entry.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/interceptors.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/interceptors.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/interceptors.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/interceptors.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/java-modules.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/java-modules.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/java-modules.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/java-modules.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/javamail.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/javamail.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/javamail.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/javamail.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/jpa-eclipselink.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/jpa-eclipselink.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/jpa-eclipselink.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/jpa-eclipselink.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
@@ -95,10 +95,22 @@
<div class="row">
<div class="col-md-12">
- <p>This example shows how to configure <code>persistence.xml</code> to work with Eclipselink. It uses an <code>@Entity</code> class and a <code>@Stateful</code> bean to add and delete entities from a database.</p>
-<h2>Creating the JPA Entity</h2>
-<p>The entity itself is simply a pojo annotated with <code>@Entity</code>. We create one pojo called <code>Movie</code> which we can use to hold movie records.</p>
-<pre><code>package org.superbiz.eclipselink;
+ <div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>This example shows how to configure <code>persistence.xml</code> to work with Eclipselink. It uses an <code>@Entity</code> class and a <code>@Stateful</code> bean to add and delete entities from a database.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_creating_the_jpa_entity">Creating the JPA Entity</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The entity itself is simply a pojo annotated with <code>@Entity</code>. We create one pojo called <code>Movie</code> which we can use to hold movie records.</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.eclipselink;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -149,11 +161,21 @@ public class Movie {
this.year = year;
}
-}
-</code></pre>
-<h2>Database Operations</h2>
-<p>This is the bean responsible for database operations; it allows us to persist or delete entities. For more information we recommend you to see <a href="http://tomee.apache.org/examples-trunk/injection-of-entitymanager/README.html">injection-of-entitymanager</a></p>
-<pre><code>package org.superbiz.eclipselink;
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_database_operations">Database Operations</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>This is the bean responsible for database operations; it allows us to persist or delete entities.
+For more information we recommend you to see <a href="http://tomee.apache.org/examples-trunk/injection-of-entitymanager/README.html">injection-of-entitymanager</a></p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.eclipselink;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
@@ -165,7 +187,7 @@ import java.util.List;
@Stateful
public class Movies {
- @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+ @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
private EntityManager entityManager;
public void addMovie(Movie movie) throws Exception {
@@ -177,32 +199,52 @@ public class Movies {
}
public List<Movie> getMovies() throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m");
+ Query query = entityManager.createQuery("SELECT m from Movie as m");
return query.getResultList();
}
-}
-</code></pre>
-<h2>Persistence.xml with EclipseLink configuration</h2>
-<p>This operation is too easy, just set the <code>provider</code> to <code>org.eclipse.persistence.jpa.PersistenceProvider</code> and add additional properties to the persistence unit. The example has followed a strategy that allows the creation of tables in a HSQL database. For a complete list of persistence unit properties see <a href="http://www.eclipse.org/eclipselink/api/2.4/org/eclipse/persistence/config/PersistenceUnitProperties.html">here</a></p>
-<pre><code><persistence version="1.0"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
- <persistence-unit name="movie-unit">
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_persistence_xml_with_eclipselink_configuration">Persistence.xml with EclipseLink configuration</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>This operation is too easy, just set the <code>provider</code> to <code>org.eclipse.persistence.jpa.PersistenceProvider</code> and add additional properties to the persistence unit.
+The example has followed a strategy that allows the creation of tables in a HSQL database.
+For a complete list of persistence unit properties see <a href="http://www.eclipse.org/eclipselink/api/2.4/org/eclipse/persistence/config/PersistenceUnitProperties.html">here</a></p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre><persistence version="1.0"
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
+ <persistence-unit name="movie-unit">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>movieDatabase</jta-data-source>
<non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source>
<properties>
- <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
- <property name="eclipselink.ddl-generation" value="create-tables"/>
- <property name="eclipselink.ddl-generation.output-mode" value="database"/>
+ <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
+ <property name="eclipselink.ddl-generation" value="create-tables"/>
+ <property name="eclipselink.ddl-generation.output-mode" value="database"/>
</properties>
</persistence-unit>
-</persistence>
-</code></pre>
-<h2>MoviesTest</h2>
+</persistence></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_moviestest">MoviesTest</h2>
+<div class="sectionbody">
+<div class="paragraph">
<p>Testing JPA is quite easy, we can simply use the <code>EJBContainer</code> API to create a container in our test case.</p>
-<pre><code>package org.superbiz.eclipselink;
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.eclipselink;
import junit.framework.TestCase;
@@ -218,32 +260,39 @@ public class MoviesTest extends TestCase
public void test() 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");
+ p.put("movieDatabase", "new://Resource?type=DataSource");
+ p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+ p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
final Context context = EJBContainer.createEJBContainer(p).getContext();
- Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies");
+ Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies");
- 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));
+ 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());
+ assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
- assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
-}
-</code></pre>
-<h1>Running</h1>
-<p>When we run our test case we should see output similar to the following. </p>
-<pre><code>-------------------------------------------------------
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<h1 id="_running" class="sect0">Running</h1>
+<div class="paragraph">
+<p>When we run our test case we should see output similar to the following.</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.eclipselink.MoviesTest
@@ -251,7 +300,7 @@ Apache OpenEJB 4.0.0-beta-1 build: 20
http://tomee.apache.org/
INFO - openejb.home = /Users/dblevins/examples/jpa-eclipselink
INFO - openejb.base = /Users/dblevins/examples/jpa-eclipselink
-INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
@@ -263,16 +312,16 @@ INFO - Auto-creating a container for bea
INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
INFO - Auto-creating a container for bean org.superbiz.eclipselink.MoviesTest: Container(type=MANAGED, id=Default Managed Container)
INFO - Configuring PersistenceUnit(name=movie-unit, provider=org.eclipse.persistence.jpa.PersistenceProvider)
-INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
+INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
INFO - Configuring Service(id=movieDatabaseNonJta, type=Resource, provider-id=movieDatabase)
-INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
-INFO - Enterprise application "/Users/dblevins/examples/jpa-eclipselink" loaded.
+INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
+INFO - Enterprise application "/Users/dblevins/examples/jpa-eclipselink" loaded.
INFO - Assembling app: /Users/dblevins/examples/jpa-eclipselink
INFO - PersistenceUnit(name=movie-unit, provider=org.eclipse.persistence.jpa.PersistenceProvider) - provider time 511ms
-INFO - Jndi(name="java:global/jpa-eclipselink/Movies!org.superbiz.eclipselink.Movies")
-INFO - Jndi(name="java:global/jpa-eclipselink/Movies")
-INFO - Jndi(name="java:global/EjbModule225280863/org.superbiz.eclipselink.MoviesTest!org.superbiz.eclipselink.MoviesTest")
-INFO - Jndi(name="java:global/EjbModule225280863/org.superbiz.eclipselink.MoviesTest")
+INFO - Jndi(name="java:global/jpa-eclipselink/Movies!org.superbiz.eclipselink.Movies")
+INFO - Jndi(name="java:global/jpa-eclipselink/Movies")
+INFO - Jndi(name="java:global/EjbModule225280863/org.superbiz.eclipselink.MoviesTest!org.superbiz.eclipselink.MoviesTest")
+INFO - Jndi(name="java:global/EjbModule225280863/org.superbiz.eclipselink.MoviesTest")
INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
INFO - Created Ejb(deployment-id=org.superbiz.eclipselink.MoviesTest, ejb-name=org.superbiz.eclipselink.MoviesTest, container=Default Managed Container)
INFO - Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
@@ -282,8 +331,9 @@ Tests run: 1, Failures: 0, Errors: 0, Sk
Results :
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-</code></pre>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</pre>
+</div>
+</div>
</div>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/jpa-enumerated.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/jpa-enumerated.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/jpa-enumerated.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/jpa-enumerated.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
@@ -95,22 +95,45 @@
<div class="row">
<div class="col-md-12">
- <p>It can sometimes be desirable to have a Java <code>enum</code> type to represent a particular column in a database. JPA supports converting database data to and from Java <code>enum</code> types via the <code>@javax.persistence.Enumerated</code> annotation.</p>
-<p>This example will show basic <code>@Enumerated</code> usage in a field of an <code>@Entity</code> as well as <code>enum</code>s as the parameter of a <code>Query</code>. We'll also see that the actual database representation can be effectively <code>String</code> or <code>int</code>.</p>
-<h2>Enum</h2>
-<p>For our example we will leverage the familiar <code>Movie</code> entity and add a new field to represent the MPAA.org rating of the movie. This is defined via a simple <code>enum</code> that requires no JPA specific annotations.</p>
-<pre><code>public enum Rating {
+ <div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>It can sometimes be desirable to have a Java <code>enum</code> type to represent a particular column in a database. JPA supports converting database data to and from Java <code>enum</code> types via the <code>@javax.persistence.Enumerated</code> annotation.</p>
+</div>
+<div class="paragraph">
+<p>This example will show basic <code>@Enumerated</code> usage in a field of an <code>@Entity</code> as well as <code>enum</code>s as the parameter of a <code>Query</code>. We’ll also see that the actual database representation can be effectively <code>String</code> or <code>int</code>.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_enum">Enum</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>For our example we will leverage the familiar <code>Movie</code> entity and add a new field to represent the MPAA.org rating of the movie. This is defined via a simple <code>enum</code> that requires no JPA specific annotations.</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>public enum Rating {
UNRATED,
G,
PG,
PG13,
R,
NC17
-}
-</code></pre>
-<h2>@Enumerated</h2>
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="__enumerated">@Enumerated</h2>
+<div class="sectionbody">
+<div class="paragraph">
<p>In our <code>Movie</code> entity, we add a <code>rating</code> field of the enum type <code>Rating</code> and annotate it with <code>@Enumerated(EnumType.STRING)</code> to declare that its value should be converted from what is effectively a <code>String</code> in the database to the <code>Rating</code> type.</p>
-<pre><code>@Entity
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>@Entity
public class Movie {
@Id
@@ -164,16 +187,30 @@ public class Movie {
public void setRating(Rating rating) {
this.rating = rating;
}
-}
-</code></pre>
-<p>The above is enough and we are effectively done. For the sake of completeness we'll show a sample <code>Query</code></p>
-<h2>Enum in JPQL Query</h2>
-<p>Note the <code>findByRating</code> method which creates a <code>Query</code> with a <code>rating</code> named parameter. The key thing to notice is that the <code>rating</code> enum instance itself is passed into the<br/> <code>query.setParameter</code> method, <strong>not</strong> <code>rating.name()</code> or <code>rating.ordinal()</code>.</p>
+}</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The above is enough and we are effectively done. For the sake of completeness we’ll show a sample <code>Query</code></p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_enum_in_jpql_query">Enum in JPQL Query</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Note the <code>findByRating</code> method which creates a <code>Query</code> with a <code>rating</code> named parameter. The key thing to notice is that the <code>rating</code> enum instance itself is passed into the
+ <code>query.setParameter</code> method, <strong>not</strong> <code>rating.name()</code> or <code>rating.ordinal()</code>.</p>
+</div>
+<div class="paragraph">
<p>Regardless if you use <code>EnumType.STRING</code> or <code>EnumType.ORDINAL</code>, you still always pass the enum itself in calls to <code>query.setParameter</code>.</p>
-<pre><code>@Stateful
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>@Stateful
public class Movies {
- @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+ @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
private EntityManager entityManager;
public void addMovie(Movie movie) {
@@ -185,97 +222,158 @@ public class Movies {
}
public List<Movie> findByRating(Rating rating) {
- final Query query = entityManager.createQuery("SELECT m FROM Movie as m WHERE m.rating = :rating");
- query.setParameter("rating", rating);
+ final Query query = entityManager.createQuery("SELECT m FROM Movie as m WHERE m.rating = :rating");
+ query.setParameter("rating", rating);
return query.getResultList();
}
public List<Movie> getMovies() throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m");
+ Query query = entityManager.createQuery("SELECT m from Movie as m");
return query.getResultList();
}
-}
-</code></pre>
-<h2>EnumType.STRING vs EnumType.ORDINAL</h2>
-<p>It is a matter of style how you would like your <code>enum</code> data represented in the database. Either <code>name()</code> or <code>ordinal()</code> are supported:</p>
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_enumtype_string_vs_enumtype_ordinal">EnumType.STRING vs EnumType.ORDINAL</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>It is a matter of style how you would like your <code>enum</code> data represented in the database. Either <code>name()</code> or <code>ordinal()</code> are supported:</p>
+</div>
+<div class="ulist">
<ul>
- <li><code>@Enumerated(EnumType.STRING) Rating rating</code> the value of <code>rating.name()</code> is written and read from the corresponding database column; e.g. <code>G</code>, <code>PG</code>, <code>PG13</code></li>
- <li><code>@Enumerated(EnumType.ORDINAL) Rating rating</code> the value of <code>rating.ordinal()</code> is written and read from the corresponding database column; e.g. <code>0</code>, <code>1</code>, <code>2</code></li>
+<li>
+<p><code>@Enumerated(EnumType.STRING) Rating rating</code> the value of <code>rating.name()</code> is written and read from the corresponding database column; e.g. <code>G</code>, <code>PG</code>, <code>PG13</code></p>
+</li>
+<li>
+<p><code>@Enumerated(EnumType.ORDINAL) Rating rating</code> the value of <code>rating.ordinal()</code> is written and read from the corresponding database column; e.g. <code>0</code>, <code>1</code>, <code>2</code></p>
+</li>
</ul>
+</div>
+<div class="paragraph">
<p>The default is <code>EnumType.ORDINAL</code></p>
+</div>
+<div class="paragraph">
<p>There are advantages and disadvantages to each.</p>
-<h3>Disadvantage of EnumType.ORDINAL</h3>
-<p>A disadvantage of <code>EnumType.ORDINAL</code> is the effect of time and the desire to keep <code>enums</code> in a logical order. With <code>EnumType.ORDINAL</code> any new enum elements must be added to the<br/><strong>end</strong> of the list or you will accidentally change the meaning of all your records.</p>
-<p>Let's use our <code>Rating</code> enum and see how it would have had to evolve over time to keep up with changes in the MPAA.org ratings system.</p>
+</div>
+<div class="sect2">
+<h3 id="_disadvantage_of_enumtype_ordinal">Disadvantage of EnumType.ORDINAL</h3>
+<div class="paragraph">
+<p>A disadvantage of <code>EnumType.ORDINAL</code> is the effect of time and the desire to keep <code>enums</code> in a logical order. With <code>EnumType.ORDINAL</code> any new enum elements must be added to the
+<strong>end</strong> of the list or you will accidentally change the meaning of all your records.</p>
+</div>
+<div class="paragraph">
+<p>Let’s use our <code>Rating</code> enum and see how it would have had to evolve over time to keep up with changes in the MPAA.org ratings system.</p>
+</div>
+<div class="paragraph">
<p><strong>1980</strong></p>
-<pre><code>public enum Rating {
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>public enum Rating {
G,
PG,
R,
UNRATED
-}
-</code></pre>
+}</pre>
+</div>
+</div>
+<div class="paragraph">
<p><strong>1984</strong> PG-13 is added</p>
-<pre><code>public enum Rating {
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>public enum Rating {
G,
PG,
R,
UNRATED,
PG13
-}
-</code></pre>
+}</pre>
+</div>
+</div>
+<div class="paragraph">
<p><strong>1990</strong> NC-17 is added</p>
-<pre><code>public enum Rating {
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>public enum Rating {
G,
PG,
R,
UNRATED,
PG13,
NC17
-}
-</code></pre>
-<p>If <code>EnumType.STRING</code> was used, then the enum could be reordered at anytime and would instead look as we have defined it originally with ratings starting at <code>G</code> and increasing in severity to <code>NC17</code> and eventually <code>UNRATED</code>. With <code>EnumType.ORDINAL</code> the logical ordering would not have withstood the test of time as new values were added.</p>
+}</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>If <code>EnumType.STRING</code> was used, then the enum could be reordered at anytime and would instead look as we have defined it originally with ratings starting at <code>G</code> and increasing in severity to <code>NC17</code> and eventually <code>UNRATED</code>. With <code>EnumType.ORDINAL</code> the logical ordering would not have withstood the test of time as new values were added.</p>
+</div>
+<div class="paragraph">
<p>If the order of the enum values is significant to your code, avoid <code>EnumType.ORDINAL</code></p>
-<h2>Unit Testing the JPA @Enumerated</h2>
-<pre><code>public class MoviesTest extends TestCase {
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_unit_testing_the_jpa_enumerated">Unit Testing the JPA @Enumerated</h2>
+<div class="sectionbody">
+<div class="literalblock">
+<div class="content">
+<pre>public class MoviesTest extends TestCase {
public void test() throws Exception {
final 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");
+ p.put("movieDatabase", "new://Resource?type=DataSource");
+ p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+ p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
EJBContainer container = EJBContainer.createEJBContainer(p);
final Context context = container.getContext();
- final Movies movies = (Movies) context.lookup("java:global/jpa-scratch/Movies");
+ final Movies movies = (Movies) context.lookup("java:global/jpa-scratch/Movies");
- movies.addMovie(new Movie("James Frawley", "The Muppet Movie", 1979, Rating.G));
- movies.addMovie(new Movie("Jim Henson", "The Great Muppet Caper", 1981, Rating.G));
- movies.addMovie(new Movie("Frank Oz", "The Muppets Take Manhattan", 1984, Rating.G));
- movies.addMovie(new Movie("James Bobin", "The Muppets", 2011, Rating.PG));
+ movies.addMovie(new Movie("James Frawley", "The Muppet Movie", 1979, Rating.G));
+ movies.addMovie(new Movie("Jim Henson", "The Great Muppet Caper", 1981, Rating.G));
+ movies.addMovie(new Movie("Frank Oz", "The Muppets Take Manhattan", 1984, Rating.G));
+ movies.addMovie(new Movie("James Bobin", "The Muppets", 2011, Rating.PG));
- assertEquals("List.size()", 4, movies.getMovies().size());
+ assertEquals("List.size()", 4, movies.getMovies().size());
- assertEquals("List.size()", 3, movies.findByRating(Rating.G).size());
+ assertEquals("List.size()", 3, movies.findByRating(Rating.G).size());
- assertEquals("List.size()", 1, movies.findByRating(Rating.PG).size());
+ assertEquals("List.size()", 1, movies.findByRating(Rating.PG).size());
- assertEquals("List.size()", 0, movies.findByRating(Rating.R).size());
+ assertEquals("List.size()", 0, movies.findByRating(Rating.R).size());
container.close();
}
-}
-</code></pre>
-<h1>Running</h1>
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<h1 id="_running" class="sect0">Running</h1>
+<div class="paragraph">
<p>To run the example via maven:</p>
-<pre><code>cd jpa-enumerated
-mvn clean install
-</code></pre>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>cd jpa-enumerated
+mvn clean install</pre>
+</div>
+</div>
+<div class="paragraph">
<p>Which will generate output similar to the following:</p>
-<pre><code>-------------------------------------------------------
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.jpa.enums.MoviesTest
@@ -283,7 +381,7 @@ Apache OpenEJB 4.0.0-beta-2 build: 20
http://tomee.apache.org/
INFO - openejb.home = /Users/dblevins/openejb/examples/jpa-enumerated
INFO - openejb.base = /Users/dblevins/openejb/examples/jpa-enumerated
-INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
@@ -295,14 +393,14 @@ INFO - Auto-creating a container for bea
INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
INFO - Auto-creating a container for bean org.superbiz.jpa.enums.MoviesTest: Container(type=MANAGED, id=Default Managed Container)
INFO - Configuring PersistenceUnit(name=movie-unit)
-INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
+INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
INFO - Configuring Service(id=movieDatabaseNonJta, type=Resource, provider-id=movieDatabase)
-INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
-INFO - Enterprise application "/Users/dblevins/openejb/examples/jpa-enumerated" loaded.
+INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
+INFO - Enterprise application "/Users/dblevins/openejb/examples/jpa-enumerated" loaded.
INFO - Assembling app: /Users/dblevins/openejb/examples/jpa-enumerated
INFO - PersistenceUnit(name=movie-unit, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 406ms
-INFO - Jndi(name="java:global/jpa-enumerated/Movies!org.superbiz.jpa.enums.Movies")
-INFO - Jndi(name="java:global/jpa-enumerated/Movies")
+INFO - Jndi(name="java:global/jpa-enumerated/Movies!org.superbiz.jpa.enums.Movies")
+INFO - Jndi(name="java:global/jpa-enumerated/Movies")
INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
INFO - Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
INFO - Deployed Application(path=/Users/dblevins/openejb/examples/jpa-enumerated)
@@ -313,8 +411,9 @@ Tests run: 1, Failures: 0, Errors: 0, Sk
Results :
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-</code></pre>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</pre>
+</div>
+</div>
</div>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/jpa-hibernate.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/jpa-hibernate.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/jpa-hibernate.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/jpa-hibernate.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
@@ -95,10 +95,23 @@
<div class="row">
<div class="col-md-12">
- <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>
-<h2>Movie</h2>
+ <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>
+</div>
+<div class="sect1">
+<h2 id="_movie">Movie</h2>
+<div class="sectionbody">
+<div class="paragraph">
<p>Define the class Movie as an entity with de annotation @Entity</p>
-<pre><code>package org.superbiz.injection.h3jpa;
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.injection.h3jpa;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -149,11 +162,21 @@ public class Movie {
this.year = year;
}
-}
-</code></pre>
-<h2>Movies</h2>
-<p>@PersistenceContext A persistence context is a set of entities such that for any persistent identity there is a unique entity instance.<br/>@EntityManager is associated with a persistence context. Is at the core of JPA, supported by some methods: persist, remove,merge, find,</p>
-<pre><code>package org.superbiz.injection.h3jpa;
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_movies">Movies</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>@PersistenceContext A persistence context is a set of entities such that for any persistent identity there is a unique entity instance.
+@EntityManager is associated with a persistence context. Is at the core of JPA, supported by some methods: persist, remove,merge, find,</p>
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.injection.h3jpa;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
@@ -165,7 +188,7 @@ import java.util.List;
@Stateful
public class Movies {
- @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+ @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
private EntityManager entityManager;
public void addMovie(Movie movie) throws Exception {
@@ -177,29 +200,43 @@ public class Movies {
}
public List<Movie> getMovies() throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m");
+ Query query = entityManager.createQuery("SELECT m from Movie as m");
return query.getResultList();
}
-}
-</code></pre>
-<h2>persistence.xml</h2>
-<pre><code><persistence version="1.0"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
- <persistence-unit name="movie-unit">
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_persistence_xml">persistence.xml</h2>
+<div class="sectionbody">
+<div class="literalblock">
+<div class="content">
+<pre><persistence version="1.0"
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
+ <persistence-unit name="movie-unit">
<provider>org.hibernate.ejb.HibernatePersistence</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="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
</properties>
</persistence-unit>
-</persistence>
-</code></pre>
-<h2>MoviesTest</h2>
-<pre><code>package org.superbiz.injection.h3jpa;
+</persistence></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_moviestest">MoviesTest</h2>
+<div class="sectionbody">
+<div class="literalblock">
+<div class="content">
+<pre>package org.superbiz.injection.h3jpa;
import junit.framework.TestCase;
@@ -215,33 +252,45 @@ public class MoviesTest extends TestCase
public void test() throws Exception {
final 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");
+ p.put("movieDatabase", "new://Resource?type=DataSource");
+ p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+ p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
final Context context = EJBContainer.createEJBContainer(p).getContext();
- Movies movies = (Movies) context.lookup("java:global/jpa-hibernate/Movies");
+ Movies movies = (Movies) context.lookup("java:global/jpa-hibernate/Movies");
- 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));
+ 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());
+ assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
- assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
-}
-</code></pre>
-<h1>Running</h1>
+}</pre>
+</div>
+</div>
+</div>
+</div>
+<h1 id="_running" class="sect0">Running</h1>
+<div class="paragraph">
<p>To run the example via maven:</p>
-<p>cd jpa-hibernate mvn clean install</p>
+</div>
+<div class="paragraph">
+<p>cd jpa-hibernate
+mvn clean install</p>
+</div>
+<div class="paragraph">
<p>Which will generate output similar to the following:</p>
-<pre><code>-------------------------------------------------------
+</div>
+<div class="literalblock">
+<div class="content">
+<pre>-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.injection.h3jpa.MoviesTest
@@ -249,7 +298,7 @@ Apache OpenEJB 4.0.0-beta-1 build: 20
http://tomee.apache.org/
INFO - openejb.home = /Users/dblevins/examples/jpa-hibernate
INFO - openejb.base = /Users/dblevins/examples/jpa-hibernate
-INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
@@ -261,16 +310,16 @@ INFO - Auto-creating a container for bea
INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
INFO - Auto-creating a container for bean org.superbiz.injection.h3jpa.MoviesTest: Container(type=MANAGED, id=Default Managed Container)
INFO - Configuring PersistenceUnit(name=movie-unit, provider=org.hibernate.ejb.HibernatePersistence)
-INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
+INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type 'DataSource for 'movie-unit'.
INFO - Configuring Service(id=movieDatabaseNonJta, type=Resource, provider-id=movieDatabase)
-INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
-INFO - Enterprise application "/Users/dblevins/examples/jpa-hibernate" loaded.
+INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
+INFO - Enterprise application "/Users/dblevins/examples/jpa-hibernate" loaded.
INFO - Assembling app: /Users/dblevins/examples/jpa-hibernate
INFO - PersistenceUnit(name=movie-unit, provider=org.hibernate.ejb.HibernatePersistence) - provider time 631ms
-INFO - Jndi(name="java:global/jpa-hibernate/Movies!org.superbiz.injection.h3jpa.Movies")
-INFO - Jndi(name="java:global/jpa-hibernate/Movies")
-INFO - Jndi(name="java:global/EjbModule1235930463/org.superbiz.injection.h3jpa.MoviesTest!org.superbiz.injection.h3jpa.MoviesTest")
-INFO - Jndi(name="java:global/EjbModule1235930463/org.superbiz.injection.h3jpa.MoviesTest")
+INFO - Jndi(name="java:global/jpa-hibernate/Movies!org.superbiz.injection.h3jpa.Movies")
+INFO - Jndi(name="java:global/jpa-hibernate/Movies")
+INFO - Jndi(name="java:global/EjbModule1235930463/org.superbiz.injection.h3jpa.MoviesTest!org.superbiz.injection.h3jpa.MoviesTest")
+INFO - Jndi(name="java:global/EjbModule1235930463/org.superbiz.injection.h3jpa.MoviesTest")
INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
INFO - Created Ejb(deployment-id=org.superbiz.injection.h3jpa.MoviesTest, ejb-name=org.superbiz.injection.h3jpa.MoviesTest, container=Default Managed Container)
INFO - Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
@@ -280,8 +329,9 @@ Tests run: 1, Failures: 0, Errors: 0, Sk
Results :
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-</code></pre>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</pre>
+</div>
+</div>
</div>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/jsf-cdi-and-ejb.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/jsf-cdi-and-ejb.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/jsf-cdi-and-ejb.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/jsf-cdi-and-ejb.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>
Modified: tomee/site/trunk/content/tomee-8.0/examples/jsf-managedBean-and-ejb.html
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/tomee-8.0/examples/jsf-managedBean-and-ejb.html?rev=1850466&r1=1850465&r2=1850466&view=diff
==============================================================================
--- tomee/site/trunk/content/tomee-8.0/examples/jsf-managedBean-and-ejb.html (original)
+++ tomee/site/trunk/content/tomee-8.0/examples/jsf-managedBean-and-ejb.html Sat Jan 5 07:51:27 2019
@@ -72,7 +72,7 @@
<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/index.html">Security</a></li>
+ <li><a href="../../security/security.html">Security</a></li>
<li><a href="../../download-ng.html">Downloads</a></li>
</ul>
</div>