<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PlanetMysql.ru - информация о СУБД MySQL &#187; totd</title>
	<atom:link href="http://planetmysql.ru/category/totd/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Fri, 25 May 2012 04:17:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>TOTD #150: Collection of GlassFish, NetBeans, JPA, JSF, JAX-WS, EJB, Jersey, MySQL, Rails, Eclipse, and OSGi tips</title>
		<link>http://blogs.sun.com/arungupta/entry/totd_150_collection_of_glassfish?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-150-collection-of-glassfish-netbeans-jpa-jsf-jax-ws-ejb-jersey-mysql-rails-eclipse-and-osgi-tips</link>
		<comments>http://blogs.sun.com/arungupta/entry/totd_150_collection_of_glassfish#comments</comments>
		<pubDate>Thu, 18 Nov 2010 14:00:23 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[jaxws]]></category>
		<category><![CDATA[jersey]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[osgi]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[totd]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/totd_150_collection_of_glassfish</guid>
		<description><![CDATA[This is the 150th tip published on this blog so decided to make it a collection of all the previous ones. Here is a tag cloud (created from wordle.net/create) from title of all the tips:

As expected GlassFish is the most prominent topic. And then there are several entries on NetBeans, JRuby/Rails, several Java EE 6 technologies like JPA, JAX-WS, JAX-RS, EJB, and JSF, and more entries on Eclipse, OSGi and some other tecnhologies too. Here is a complete collection of all the tips published so far:

    #149: How to clean IntelliJ cache, preferences, etc on Mac OS X ?
    #148: JPA2 Metamodel Classes in NetBeans 7.0 - Writing type-safe Criteria API
    #147: Java Server Faces 2.0 Composite Components using NetBeans - DRY your code
    #146: Understanding the EJB 3.1 Timer service in Java EE 6 - Programmatic, Deployment Descriptor, @Schedule
    #145: CDI Events - a light-weight producer/consumer in Java EE 6
    #144: CDI @Produces for container-managed @Resource
    #143: Retrieve Twitter user timeline using using Jersey and OAuth
    #142: GlassFish 3.1 - SSH Provisioning and Start/Stop instance/cluster on local/remote machines
    #141: Running GlassFish 3.1 on Ubuntu 10.04 AMI on Amazon EC2
    #140: Moving GlassFish Installation - Referenced file does not exist &#34;osgi-main.jar&#34;
    #139: Asynchronous Request Processing using Servlets 3.0 and Java EE 6
    #138: GlassFish 3.1 Milestone 1 - Clustering and Application Versioning Demos
    #137: Asynchronous EJB, a light-weight JMS solution - Feature-rich Java EE 6
    #136: Default Error Page using Servlets 3.0 - Improved productivity using Java EE 6
    #135: JSF2 Composite Components using NetBeans IDE - lightweight Java EE 6
    #134: Interceptors 1.1 in Java EE 6 - What and How ?
    #133: JPA2 (JPQL &#38; Criteria), JavaDB, and embedded GlassFish - perfect recipe for testing
    #132: Servlets 3.0 in Embedded GlassFish Reloaded - lightweight Java EE 6
    #131: Dynamic OSGi services in GlassFish - Using ServiceTracker
    #130: Invoking a OSGi service from a JAX-WS Endpoint - OSGi and Enterprise Java
    #129: Managed Beans 1.0 in Java EE 6 - What and How ?
    #128: EJBContainer.createEJBContainer: Embedded EJB using GlassFish v3
    #127: Embedding GlassFish in an existing OSGi runtime - Eclipse Equinox
    #126: Creating an OSGi bundles using Eclipse and deploying in GlassFish
    #125: Creating an OSGi bundles using NetBeans and deploying in GlassFish
    #124: OSGi Declarative Services in GlassFish - Accessed from a Java EE client
    #124: Using CDI + JPA with JAX-RS and JAX-WS
    #123: f:ajax, Bean Validation for JSF, CDI for JSF and JPA 2.0 Criteria API - all in one Java EE 6 sample application
    #122: Creating a JPA Persistence Unit using NetBeans 6.8
    #121: JDBC resource for MySQL and Oracle sample database in GlassFish v3
    #120: Deployment Descriptor-free Java EE 6 application using JSF 2.0 + EJB 3.1 + Servlets 3.0
    #119: Telnet to GlassFish v3 with NetBeans 6.8 - &#34;Could not open connection to the host&#34;
    #118: Managing OSGi bundles in GlassFish v3 - asadmin, filesystem, telnet console, web browser, REST, osgish
    #117: Invoke a JAX-WS Web service from a Rails app deployed in GlassFish
    #116: GlassFish v3 Administration using JavaFX front-end - JNLP available
    #115: GlassFish in Eclipse - Integrated Bundle, Install Stand-alone or Update Existing plugin
    #114: How to enable Java Console in Mac OS X, Windows, ... ?
    #113: JavaFX front-end for GlassFish v3 Administration - Using REST interface
    #112: Exposing Oracle database tables as RESTful entities using JAX-RS, GlassFish, and NetBeans
    #111: Rails Scaffold for a pre-existing table using Oracle and GlassFish
    #110: JRuby on Rails application using Oracle on GlassFish
    #109: How to convert a JSF managed bean to JSR 299 bean (Web Beans) ?
    #108: Java EE 6 web application (JSF 2.0 + JPA 2.0 + EJB 3.1) using Oracle, NetBeans, and GlassFish
    #107: Connect to Oracle database using NetBeans
    #106: How to install Oracle Database 10g on Mac OS X (Intel) ?
    TOTD #105: GlassFish v3 Monitoring – How to monitor a Rails app using asadmin, JavaScript, jConsole, REST ?
    #104: Popular Ruby-on-Rails applications on GlassFish v3 – Redmine, Typo, Substruct
    #103: GlassFish v3 with different OSGi runtimes – Felix, Equinox, and Knoplerfish
    #102: Java EE 6 (Servlet 3.0 and EJB 3.1) wizards in Eclipse
    #101: Applying Servlet 3.0/Java EE 6 “web-fragment.xml” to Lift – Deploy on GlassFish v3
    #100: Getting Started with Scala Lift on GlassFish v3
    #99: Creating a Java EE 6 application using MySQL, JPA 2.0 and Servlet 3.0 with GlassFish Tools Bundle for Eclipse
    #98: Create a Metro JAX-WS Web service using GlassFish Tools Bundle for Eclipse
    #97: GlassFish Plugin with Eclipse 3.5
    #96: GlassFish v3 REST Interface to Monitoring and Management - JSON, XML, and HTML representations
    #95: EJB 3.1 + Java Server Faces 2.0 + JPA 2.0 web application - Getting Started with Java EE 6 using NetBeans 6.8 M1 &#38; GlassFish v3
    #94: A simple Java Server Faces 2.0 + JPA 2.0 application - Getting Started with Java EE 6 using NetBeans 6.8 M1 &#38; GlassFish v3
    #93: Getting Started with Java EE 6 using NetBeans 6.8 M1 &#38; GlassFish v3 - A simple Servlet 3.0 + JPA 2.0 app
    #92: Session Failover for Rails applications running on GlassFish
    #91: Applying Java EE 6 &#34;web-fragment.xml&#34; to Apache Wicket - Deploy on GlassFish v3
    #90: Migrating from Wicket 1.3.x to 1.4 - &#34;Couldn't load DiskPageStore index from file&#34; error
    #89: How to add pagination to an Apache Wicket application
    #88: How add pagination to Rails - will_paginate
    #87: How to fix the error undefined method `new' for &#34;Rack::Lock&#34;:String caused by Warbler/JRuby-Rack ?
    #86: Getting Started with Apache Wicket on GlassFish
    #85: Getting Started with Django Applications on GlassFish v3
    #84: Using Apache + mod_proxy_balancer to load balance Ruby-on-Rails running on GlassFish
    #83: Eclipse Tools Bundle for GlassFish 1.0 - Now Available!
    #82: Getting Started with Servlet 3.0 and EJB 3.1 in Java EE 6 using NetBeans 6.7
    #81: How to use nginx to load balance a cluster of GlassFish Gem ?
    #80: Sinatra CRUD application using Haml templates with JRuby and GlassFish Gem
    #79: Getting Started with Sinatra applications on JRuby and GlassFish Gem
    #78: GlassFish, EclipseLink, and MySQL efficient pagination using LIMIT
    #77: Running Seam examples with GlassFish
    #76: JRuby 1.2, Rails 2.3, GlassFish Gem 0.9.3, ActiveRecord JDBC Adapter 0.9.1 - can they work together ?
    #75: Getting Started with Grails using GlassFish v3 Embedded
    #74: JRuby and GlassFish Integration Test #5: JRuby 1.2.0 RC2 + Rails 2.x.x + GlassFish + Redmine
    #73: JRuby and GlassFish Integration Test #4: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v2 + Warbler
    #72: JRuby and GlassFish Integration Test #3: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v3
    #71: JRuby and GlassFish Integration Test #2: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish v3 Prelude
    #70: JRuby and GlassFish Integration Test# 1: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish Gem
    #69: GlassFish High Availability/Clustering using Sun Web Server + Load Balancer Plugin on Windows Vista
    #68: Installing Zones in Open Solaris 2008/11 on Virtual Box
    #67: How to front-end a GlassFish Cluster with Apache + mod_jk on Mac OSX Leopard ?
    #66: GlassFish Eclipse Plugin 1.0.16 - Install v3 Prelude from the IDE
    #65: Windows 7 Beta 1 Build 7000 on Virtual Box: NetBeans + Rails + GlassFish + MySQL
    #64: OpenSolaris 2008/11 using Virtual Box
    #63: jmx4r gem - How to manage/monitor your Rails/Merb applications on JRuby/GlassFish ?
    #62: How to remotely manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX API ?
    #61: How to locally manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX ?
    #60: Configure MySQL 6.0.x-alpha to NetBeans 6.5
    #59: How to add Twitter feeds to blogs.sun.com ? + Other Twitter Tools
    #58: Jersey and GlassFish - how to process POST requests ?
    #57: Jersey Client API - simple and easy to use
    #56: Simple RESTful Web service using Jersey and Embeddable GlassFish - Text and JSON output
    #55: How to build GlassFish v3 Gem ?
    #54: Java Server Faces with Eclipse IDE
    #53: Scaffold in Merb using JRuby/GlassFish
    #52: Getting Started with Merb using GlassFish Gem
    #51: Embedding Google Maps in Java Server Faces using GMaps4JSF
    #50: Mojarra 2.0 EDR2 is now available - Try them with GlassFish v3 and NetBeans 6.5
    #49: Converting a JSF 1.2 application to JSF 2.0 - @ManagedBean
    #48: Converting a JSF 1.2 application to JSF 2.0 - Facelets and Ajax
    #47: Getting Started with Mojarra 2.0 nightly on GlassFish v2
    #46: Facelets with Java Server Faces 1.2
    #45: Ajaxifying Java Server Faces using JSF Extensions
    #44: JDBC Connection Pooling for Rails on GlassFish v3
    #43: GlassFish v3 Build Flavors
    #42: Hello JavaServer Faces World with NetBeans and GlassFish
    #41: How I created transparent logo of GlassFish using Gimp ?
    #40: jQuery Autcomplete widget with MySQL, GlassFish, NetBeans
    #39: Prototype/Script.aculo.us Autcomplete widget with MySQL, GlassFish, NetBeans
    #38: Creating a MySQL Persistence Unit using NetBeans IDE
    #37: SQLite3 with Ruby-on-Rails on GlassFish Gem
    #36: Writing First Test for a Rails Application
    #35: Rails Database Connection on Solaris
    #34: Using Felix Shell with GlassFish
    #33: Building GlassFish v3 Workspace
    #32: Rails Deployment on GlassFish v3 from NetBeans IDE
    #31: CRUD Application using Grails - Hosted on GlassFish and MySQL
    #30: CRUD Application using Grails - Hosted on Jetty and HSQLDB
    #29: Enabling &#34;Available Plugins&#34; tab in NetBeans IDE
    #28: Getting Started with Rails 2.0 Scaffold
    #27: Configurable Multiple Ruby Platforms in NetBeans 6.1 M1
    #26: Overriding Database Defaults in Rails 2.0.2
    #25: Rails application with PostgreSQL database using NetBeans
    #24: Getting Started with Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1RC1
    #23: JavaFX Client invoking a Metro endpoint
    #22: Java SE client for a Metro endpoint
    #21: Metro 1.1 with GlassFish v2 UR1 and NetBeans 6
    #20: How to create a new jMaki widget ?
    #19: How to Add Metro Quality-of-Service to Contract-First Endpoint ?
    #18: How to Build The GlassFish v3 Gem for JRuby ?
    #17: Backing Up your Blog Posts on Roller
    #16: Optimizing Metro Stubs by locally packaging the WSDL
    #15: Delete/Update Row from Database using jMaki Data Table
    #14: How to generate JRuby-on-Rails Controller on Windows (#9893)
    #13: Setup Mongrel for JRuby-on-Rails applications on Windows
    #12: Invoking a Java EE 5 Web service endpoint from JRuby
    #11: Setup Mongrel cluster for JRuby-on-Rails applications on Unix
    #10: Consuming JSON and XML representations generated by a Jersey endpoint in a jMaki Table widget
    #9: Using JDBC connection pool/JNDI name from GlassFish in Rails Application
    #8: Generating JSON using JAXB annotations in Jersey
    #7: Switch between JRuby and CRuby interpreter in NetBeans 6
    #6: Difference between Ruby Gem and Rails Plugin
    #5: Loading data from beans in jMaki widgets
    #4: How to convert a Session EJB to a Web service ?
    #3: Using JavaDB with JRuby on Rails
    #2: Change the endpoint address on a pre-generated Web services Stub
    #1: SOAP Messaging Logging in Metro

Just for fun, here is another tag cloud:

You can access all the tips here. And keep those suggestions coming!
Technorati: totd glassfish netbeans jpa jsf jaxws jersey mysql rails osgi eclipse]]></description>
			<content:encoded><![CDATA[<p>This is the 150th tip published on <a href="http://blogs.sun.com/arungupta">this blog</a> so decided to make it a collection of all <a href="http://blogs.sun.com/arungupta/tags/totd">the previous ones</a>. Here is a tag cloud (created from <a href="http://wordle.net/create">wordle.net/create</a>) from title of all the tips:</p>
<p><img height="259" style="margin: 5px" width="700" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/11/totd150-tag-cloud.png" /></p>
<p>As expected <a href="http://glassfish.org">GlassFish</a> is the most prominent topic. And then there are several entries on NetBeans, JRuby/Rails, several Java EE 6 technologies like JPA, JAX-WS, JAX-RS, EJB, and JSF, and more entries on Eclipse, OSGi and some other tecnhologies too. Here is a complete collection of all the tips published so far:</p>
<ul>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_149_how_to_clean">#149: How to clean IntelliJ cache, preferences, etc on Mac OS X ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_148_jpa2_metamodel_classes">#148: JPA2 Metamodel Classes in NetBeans 7.0 - Writing type-safe Criteria API</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_147_java_server_faces">#147: Java Server Faces 2.0 Composite Components using NetBeans - DRY your code</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_146_understanding_the_ejb">#146: Understanding the EJB 3.1 Timer service in Java EE 6 - Programmatic, Deployment Descriptor, @Schedule</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_145_cdi_events_a">#145: CDI Events - a light-weight producer/consumer in Java EE 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_144_cdi_produces_for">#144: CDI @Produces for container-managed @Resource</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_143_retrieve_twitter_user">#143: Retrieve Twitter user timeline using using Jersey and OAuth</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/ttod_142_glassfish_3_1">#142: GlassFish 3.1 - SSH Provisioning and Start/Stop instance/cluster on local/remote machines</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_141_running_glassfish_3">#141: Running GlassFish 3.1 on Ubuntu 10.04 AMI on Amazon EC2</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_140_moving_glassfish_installation">#140: Moving GlassFish Installation - Referenced file does not exist &quot;osgi-main.jar&quot;</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_139_asynchronous_request_processing">#139: Asynchronous Request Processing using Servlets 3.0 and Java EE 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_138_glassfish_3_1">#138: GlassFish 3.1 Milestone 1 - Clustering and Application Versioning Demos</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_137_asynchronous_ejb_a">#137: Asynchronous EJB, a light-weight JMS solution - Feature-rich Java EE 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_136_default_error_page">#136: Default Error Page using Servlets 3.0 - Improved productivity using Java EE 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_135_jsf2_custom_components">#135: JSF2 Composite Components using NetBeans IDE - lightweight Java EE 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_134_interceptors_1_1">#134: Interceptors 1.1 in Java EE 6 - What and How ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_133_jpa2_jpql_criteria">#133: JPA2 (JPQL &amp; Criteria), JavaDB, and embedded GlassFish - perfect recipe for testing</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_132_servlets_3_0">#132: Servlets 3.0 in Embedded GlassFish Reloaded - lightweight Java EE 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_131_dynamic_osgi_services">#131: Dynamic OSGi services in GlassFish - Using ServiceTracker</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_130_invoking_a_osgi">#130: Invoking a OSGi service from a JAX-WS Endpoint - OSGi and Enterprise Java</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_129_managed_beans_1">#129: Managed Beans 1.0 in Java EE 6 - What and How ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_128_ejbcontainer_createejbcontainer_embedded">#128: EJBContainer.createEJBContainer: Embedded EJB using GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_127_embedding_glassfish_in">#127: Embedding GlassFish in an existing OSGi runtime - Eclipse Equinox</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_126_creating_an_osgi">#126: Creating an OSGi bundles using Eclipse and deploying in GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_125_creating_an_osgi">#125: Creating an OSGi bundles using NetBeans and deploying in GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_124_osgi_declarative_services">#124: OSGi Declarative Services in GlassFish - Accessed from a Java EE client</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_124_using_cdi_jpa">#124: Using CDI + JPA with JAX-RS and JAX-WS</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_123_f_ajax_bean">#123: f:ajax, Bean Validation for JSF, CDI for JSF and JPA 2.0 Criteria API - all in one Java EE 6 sample application</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_122_creating_a_jpa">#122: Creating a JPA Persistence Unit using NetBeans 6.8</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for">#121: JDBC resource for MySQL and Oracle sample database in GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_120_deployment_descriptor_free">#120: Deployment Descriptor-free Java EE 6 application using JSF 2.0 + EJB 3.1 + Servlets 3.0</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_119_telnet_to_glassfish">#119: Telnet to GlassFish v3 with NetBeans 6.8 - &quot;Could not open connection to the host&quot;</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_118_managing_osgi_bundles">#118: Managing OSGi bundles in GlassFish v3 - asadmin, filesystem, telnet console, web browser, REST, osgish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_117_invoke_a_jax">#117: Invoke a JAX-WS Web service from a Rails app deployed in GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_116_glassfish_v3_administration">#116: GlassFish v3 Administration using JavaFX front-end - JNLP available</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_115_glassfish_in_eclipse">#115: GlassFish in Eclipse - Integrated Bundle, Install Stand-alone or Update Existing plugin</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_114_how_to_enable">#114: How to enable Java Console in Mac OS X, Windows, ... ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_113_javafx_front_end">#113: JavaFX front-end for GlassFish v3 Administration - Using REST interface</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_112_exposing_oracle_database">#112: Exposing Oracle database tables as RESTful entities using JAX-RS, GlassFish, and NetBeans</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/http_blog_arungupta_me_2009">#111: Rails Scaffold for a pre-existing table using Oracle and GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_110_jruby_on_rails">#110: JRuby on Rails application using Oracle on GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_109_how_to_convert">#109: How to convert a JSF managed bean to JSR 299 bean (Web Beans) ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_108_java_ee_6">#108: Java EE 6 web application (JSF 2.0 + JPA 2.0 + EJB 3.1) using Oracle, NetBeans, and GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_107_connect_to_oracle">#107: Connect to Oracle database using NetBeans</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_105_how_to_install">#106: How to install Oracle Database 10g on Mac OS X (Intel) ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_104_glassfish_v3_monitoring">TOTD #105: GlassFish v3 Monitoring – How to monitor a Rails app using asadmin, JavaScript, jConsole, REST ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/popular_ruby_on_rails_applications">#104: Popular Ruby-on-Rails applications on GlassFish v3 – Redmine, Typo, Substruct</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_103_glassfish_v3_with">#103: GlassFish v3 with different OSGi runtimes – Felix, Equinox, and Knoplerfish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_102_java_ee_6">#102: Java EE 6 (Servlet 3.0 and EJB 3.1) wizards in Eclipse</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_101_applying_servlet_3">#101: Applying Servlet 3.0/Java EE 6 “web-fragment.xml” to Lift – Deploy on GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_100_getting_started_with">#100: Getting Started with Scala Lift on GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_99_creating_a_java">#99: Creating a Java EE 6 application using MySQL, JPA 2.0 and Servlet 3.0 with GlassFish Tools Bundle for Eclipse</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_98_create_a_metro">#98: Create a Metro JAX-WS Web service using GlassFish Tools Bundle for Eclipse</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_97_glassfish_plugin_with">#97: GlassFish Plugin with Eclipse 3.5</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_96_glassfish_v3_rest">#96: GlassFish v3 REST Interface to Monitoring and Management - JSON, XML, and HTML representations</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1">#95: EJB 3.1 + Java Server Faces 2.0 + JPA 2.0 web application - Getting Started with Java EE 6 using NetBeans 6.8 M1 &amp; GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java">#94: A simple Java Server Faces 2.0 + JPA 2.0 application - Getting Started with Java EE 6 using NetBeans 6.8 M1 &amp; GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with">#93: Getting Started with Java EE 6 using NetBeans 6.8 M1 &amp; GlassFish v3 - A simple Servlet 3.0 + JPA 2.0 app</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_92_session_failover_for">#92: Session Failover for Rails applications running on GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_91_applying_java_ee">#91: Applying Java EE 6 &quot;web-fragment.xml&quot; to Apache Wicket - Deploy on GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_90_migrating_from_wicket">#90: Migrating from Wicket 1.3.x to 1.4 - &quot;Couldn't load DiskPageStore index from file&quot; error</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_89_how_to_add">#89: How to add pagination to an Apache Wicket application</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_88_how_add_pagination">#88: How add pagination to Rails - will_paginate</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_87_how_to_fix">#87: How to fix the error undefined method `new' for &quot;Rack::Lock&quot;:String caused by Warbler/JRuby-Rack ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_86_getting_started_with">#86: Getting Started with Apache Wicket on GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_85_getting_started_with">#85: Getting Started with Django Applications on GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_84_using_apache_mod">#84: Using Apache + mod_proxy_balancer to load balance Ruby-on-Rails running on GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_82_eclipse_tools_bundle">#83: Eclipse Tools Bundle for GlassFish 1.0 - Now Available!</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_81_getting_started_with">#82: Getting Started with Servlet 3.0 and EJB 3.1 in Java EE 6 using NetBeans 6.7</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_81_how_to_use">#81: How to use nginx to load balance a cluster of GlassFish Gem ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_80_sinatra_crud_application">#80: Sinatra CRUD application using Haml templates with JRuby and GlassFish Gem</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_79_getting_started_with">#79: Getting Started with Sinatra applications on JRuby and GlassFish Gem</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_78_glassfish_eclipselink_and">#78: GlassFish, EclipseLink, and MySQL efficient pagination using LIMIT</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_77_running_seam_examples">#77: Running Seam examples with GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_76_jruby_1_2">#76: JRuby 1.2, Rails 2.3, GlassFish Gem 0.9.3, ActiveRecord JDBC Adapter 0.9.1 - can they work together ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_75_getting_started_with">#75: Getting Started with Grails using GlassFish v3 Embedded</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_74_jruby_and_glassfish">#74: JRuby and GlassFish Integration Test #5: JRuby 1.2.0 RC2 + Rails 2.x.x + GlassFish + Redmine</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_73_jruby_and_glassfish">#73: JRuby and GlassFish Integration Test #4: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v2 + Warbler</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_72_jruby_and_glassfish">#72: JRuby and GlassFish Integration Test #3: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_71_jruby_and_glassfish">#71: JRuby and GlassFish Integration Test #2: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish v3 Prelude</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_70_jruby_and_glassfish">#70: JRuby and GlassFish Integration Test# 1: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish Gem</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_69_glassfish_high_availability">#69: GlassFish High Availability/Clustering using Sun Web Server + Load Balancer Plugin on Windows Vista</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_68_installing_zones_in">#68: Installing Zones in Open Solaris 2008/11 on Virtual Box</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_67_how_to_front">#67: How to front-end a GlassFish Cluster with Apache + mod_jk on Mac OSX Leopard ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_66_glassfish_eclipse_plugin">#66: GlassFish Eclipse Plugin 1.0.16 - Install v3 Prelude from the IDE</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_65_windows_7_beta">#65: Windows 7 Beta 1 Build 7000 on Virtual Box: NetBeans + Rails + GlassFish + MySQL</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_64_opensolaris_2008_11">#64: OpenSolaris 2008/11 using Virtual Box</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_63_jmx4r_gem_how">#63: jmx4r gem - How to manage/monitor your Rails/Merb applications on JRuby/GlassFish ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_62_how_to_remotely">#62: How to remotely manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX API ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_61_how_to_locally">#61: How to locally manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_60_configure_mysql_6">#60: Configure MySQL 6.0.x-alpha to NetBeans 6.5</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_59_how_to_add">#59: How to add Twitter feeds to blogs.sun.com ? + Other Twitter Tools</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_58_jersey_and_glassfish">#58: Jersey and GlassFish - how to process POST requests ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_57_jersey_client_api">#57: Jersey Client API - simple and easy to use</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_56_simple_restful_web">#56: Simple RESTful Web service using Jersey and Embeddable GlassFish - Text and JSON output</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_55_how_to_build">#55: How to build GlassFish v3 Gem ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_54_java_server_faces">#54: Java Server Faces with Eclipse IDE</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_53_scaffold_in_merb">#53: Scaffold in Merb using JRuby/GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/getting_started_with_merb_using">#52: Getting Started with Merb using GlassFish Gem</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_51_embedding_google_maps">#51: Embedding Google Maps in Java Server Faces using GMaps4JSF</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_50_mojarra_2_0">#50: Mojarra 2.0 EDR2 is now available - Try them with GlassFish v3 and NetBeans 6.5</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_49_converting_a_jsf">#49: Converting a JSF 1.2 application to JSF 2.0 - @ManagedBean</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_48_converting_a_jsf">#48: Converting a JSF 1.2 application to JSF 2.0 - Facelets and Ajax</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_47_getting_started_with">#47: Getting Started with Mojarra 2.0 nightly on GlassFish v2</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_46_facelets_with_java">#46: Facelets with Java Server Faces 1.2</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_45_ajaxifying_java_server">#45: Ajaxifying Java Server Faces using JSF Extensions</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_44_jdbc_connection_pooling">#44: JDBC Connection Pooling for Rails on GlassFish v3</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_43_glassfish_v3_build">#43: GlassFish v3 Build Flavors</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_42_hello_javaserver_faces">#42: Hello JavaServer Faces World with NetBeans and GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_41_how_i_created">#41: How I created transparent logo of GlassFish using Gimp ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_40_jquery_autcomplete_widget">#40: jQuery Autcomplete widget with MySQL, GlassFish, NetBeans</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_39_prototype_script_aculo">#39: Prototype/Script.aculo.us Autcomplete widget with MySQL, GlassFish, NetBeans</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_38_creating_a_mysql">#38: Creating a MySQL Persistence Unit using NetBeans IDE</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_37_sqlite3_with_ruby">#37: SQLite3 with Ruby-on-Rails on GlassFish Gem</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_36_writing_first_test">#36: Writing First Test for a Rails Application</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_35_rails_database_connection">#35: Rails Database Connection on Solaris</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_34_using_felix_shell">#34: Using Felix Shell with GlassFish</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_33_building_glassfish_v3">#33: Building GlassFish v3 Workspace</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_32_rails_deployment_on">#32: Rails Deployment on GlassFish v3 from NetBeans IDE</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_31_crud_application_using">#31: CRUD Application using Grails - Hosted on GlassFish and MySQL</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_30_crud_application_using">#30: CRUD Application using Grails - Hosted on Jetty and HSQLDB</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_29_enabling_available_plugins">#29: Enabling &quot;Available Plugins&quot; tab in NetBeans IDE</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_28_getting_started_with">#28: Getting Started with Rails 2.0 Scaffold</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_27_configurable_multiple_ruby">#27: Configurable Multiple Ruby Platforms in NetBeans 6.1 M1</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_26_overriding_database_defaults">#26: Overriding Database Defaults in Rails 2.0.2</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_25_rails_application_with">#25: Rails application with PostgreSQL database using NetBeans</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_24_getting_started_with">#24: Getting Started with Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1RC1</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_23_javafx_client_invoking">#23: JavaFX Client invoking a Metro endpoint</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_22_java_se_client">#22: Java SE client for a Metro endpoint</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_21_metro_1_1">#21: Metro 1.1 with GlassFish v2 UR1 and NetBeans 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_19_how_to_create">#20: How to create a new jMaki widget ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_18_how_to_add">#19: How to Add Metro Quality-of-Service to Contract-First Endpoint ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_18_how_to_build1">#18: How to Build The GlassFish v3 Gem for JRuby ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_17_backin_up_your">#17: Backing Up your Blog Posts on Roller</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_16_optimizing_metro_stubs">#16: Optimizing Metro Stubs by locally packaging the WSDL</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_15_delete_update_row">#15: Delete/Update Row from Database using jMaki Data Table</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_14_how_to_generate">#14: How to generate JRuby-on-Rails Controller on Windows (#9893)</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_13_setup_mongrel_for">#13: Setup Mongrel for JRuby-on-Rails applications on Windows</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_12_invoking_a_java">#12: Invoking a Java EE 5 Web service endpoint from JRuby</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_11_setup_mongrel_cluster">#11: Setup Mongrel cluster for JRuby-on-Rails applications on Unix</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_10_consuming_json_and">#10: Consuming JSON and XML representations generated by a Jersey endpoint in a jMaki Table widget</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_9_using_jdbc_connection">#9: Using JDBC connection pool/JNDI name from GlassFish in Rails Application</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_8_generating_json_using">#8: Generating JSON using JAXB annotations in Jersey</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_7_switch_between_jruby">#7: Switch between JRuby and CRuby interpreter in NetBeans 6</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_6_difference_between_ruby">#6: Difference between Ruby Gem and Rails Plugin</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_5_loading_data_from">#5: Loading data from beans in jMaki widgets</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_4_how_to_convert">#4: How to convert a Session EJB to a Web service ?</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_3_using_javadb_with">#3: Using JavaDB with JRuby on Rails</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_2_change_the_endpoint">#2: Change the endpoint address on a pre-generated Web services Stub</a></li>
    <li><a href="http://blogs.sun.com/arungupta/entry/totd_1_soap_messaging_logging">#1: SOAP Messaging Logging in Metro</a></li>
</ul>
<p>Just for fun, here is another tag cloud:</p>
<p><img height="264" style="margin: 5px" width="700" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/11/totd150-tag-cloud2.png" /></p>
<p>You can access all the tips <a href="http://blogs.sun.com/arungupta/tags/totd">here</a>. And keep those suggestions coming!</p>
<p><small>Technorati: <a href="http://technorati.com/tags/totd">totd</a> <a href="http://technorati.com/tags/glassfish">glassfish</a> <a href="http://technorati.com/tags/netbeans">netbeans</a> <a href="http://technorati.com/tags/jpa">jpa</a> <a href="http://technorati.com/tags/jsf">jsf</a> <a href="http://technorati.com/tags/jaxws">jaxws</a> <a href="http://technorati.com/tags/jersey">jersey</a> <a href="http://technorati.com/tags/mysql">mysql</a> <a href="http://technorati.com/tags/rails">rails</a> <a href="http://technorati.com/tags/osgi">osgi</a> <a href="http://technorati.com/tags/eclipse">eclipse</a></small></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26501&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26501&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/11/18/totd-150-collection-of-glassfish-netbeans-jpa-jsf-jax-ws-ejb-jersey-mysql-rails-eclipse-and-osgi-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOTD #122: Creating a JPA Persistence Unit using NetBeans 6.8</title>
		<link>http://blogs.sun.com/arungupta/entry/totd_122_creating_a_jpa?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-122-creating-a-jpa-persistence-unit-using-netbeans-6-8</link>
		<comments>http://blogs.sun.com/arungupta/entry/totd_122_creating_a_jpa#comments</comments>
		<pubDate>Wed, 10 Feb 2010 07:08:43 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[eclipselink]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[persistenceunit]]></category>
		<category><![CDATA[sakila]]></category>
		<category><![CDATA[totd]]></category>
		<category><![CDATA[v3]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/totd_122_creating_a_jpa</guid>
		<description><![CDATA[Taking TOTD #121 forward, this blog explains how to create a JPA Persistence Unit for a MySQL sample database and package it as a library. This JAR file can then be easily included in other web applications.
Lets get started!

    Configure GlassFish for using the MySQL sample database (sakila) as described in TOTD #121.
    Add the GlassFish instance in NetBeans IDE using &#34;Services&#34; panel.
    
Create JPA entities using NetBeans IDE.
        
            Create a Java class library:Our ultimate goal is to create a reusable JAR file and that's why this project type is chosen.
            Specify the name of project as &#34;SakilaPU&#34;:
            Right-click on the project and select &#34;New&#34;, &#34;Entity Classes from Database ...&#34; to initiate the process of entity generation:
            
Choose the database connection as:If not configured, then can be easily done by clicking on &#34;New Database Connection ...&#34; in the list box.
                
                    Click on &#34;Add All &#62;&#62;&#34; to generate the mapped JPA entities for all tables and views.
                    The views do not have primary keys and will need to be appropriately annotated (described later).
                    Click on &#34;Next &#62;&#34;.
                
            
            Give the package name as:and specify the package name as &#34;sakila&#34;. Click on &#34;Create Persistence Unit ...&#34;.
            Change the default PU name from &#34;SakilaPUPU&#34; to &#34;SakilaPU&#34;:and click on &#34;Finish&#34;. Notice that &#34;EclipseLink&#34;, the Reference Implementation of JPA 2.0, is used as the persistence library.
            
Add &#34;@javax.persistence.Id&#34; annotation to the following class/field combination:
                
                    
                        Class
                        Field
                    
                    
                        sakila.SalesByFilmCategory
                        category
                    
                    
                        sakila.ActorInfo
                        actorId
                    
                    
                        sakila.FilmList
                        fid
                    
                    
                        sakila.CustomerList
                        id
                    
                    
                        sakila.NicerButSlowerFilmList
                        fid
                    
                    
                        sakila.StaffList
                        id
                    
                    
                        sakila.SalesByStore
                        store
                    
                
This is required because none of the &#34;views&#34; are defined with a primary key.            
            
                Right-click on the project and select &#34;Clean &#38; Build&#34;. This generates &#34;dist/SakilaPU.jar&#34; and the structure looks like:
                
            
        
    

This JAR file can now be included in any web application. The pre-built JAR file can also be downloaded here. The key items to note about this pre-built JAR:

    Persistence Unit Name: &#34;SakilaPU&#34;
    All classes are in &#34;sakila.*&#34; package.
    Each class has a pre-defined &#34;&#60;CLASS-NAME&#62;.findAll&#34; named query that returns all elements from the underlying view/table.
    Can be easily added in &#34;WEB-INF/lib&#34; directory of your web application.

Even though this blog uses a MySQL sample database, these steps can be easily followed for any other database such as Oracle or JavaDB.
Technorati: totd javaee glassfish v3 jpa eclipselink persistenceunit mysql sakila netbeans]]></description>
			<content:encoded><![CDATA[<p>Taking <a href="http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for">TOTD #121</a> forward, this blog explains how to create a JPA Persistence Unit for a MySQL sample database and package it as a library. This JAR file can then be easily included in other web applications.</p>
<p>Lets get started!</p>
<ol>
    <li>Configure <a href="http://glassfish.org">GlassFish</a> for using the MySQL sample database (<a href="http://dev.mysql.com/doc/sakila/en/sakila.html">sakila</a>) as described in <a href="http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for">TOTD #121</a>.</li>
    <li>Add the GlassFish instance in <a href="http://netbeans.org">NetBeans IDE</a> using &quot;Services&quot; panel.</li>
    <li>
Create JPA entities using NetBeans IDE.
        <ol>
            <li>Create a Java class library:<br /><br /><img border="1" style="margin: 5px" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-create-java-class-library.png" /><br /><br />Our ultimate goal is to create a reusable JAR file and that's why this project type is chosen.<br /></li>
            <li>Specify the name of project as &quot;SakilaPU&quot;:<br /><br /><img border="1" style="margin: 5px" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-name-and-location.png" /><br /></li>
            <li>Right-click on the project and select &quot;New&quot;, &quot;Entity Classes from Database ...&quot; to initiate the process of entity generation:<br /><br /><img border="1" style="margin: 5px" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-entity-classes-from-database.png" /></li>
            <li>
Choose the database connection as:<br /><br /><img border="1" style="margin: 5px" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-db-connection.png" /><br /><br />If not configured, then can be easily done by clicking on &quot;New Database Connection ...&quot; in the list box.
                <ol>
                    <li>Click on &quot;Add All &gt;&gt;&quot; to generate the mapped JPA entities for all tables and views.</li>
                    <li>The views do not have primary keys and will need to be appropriately annotated (described later).</li>
                    <li>Click on &quot;Next &gt;&quot;.<br /></li>
                </ol>
            </li>
            <li>Give the package name as:<br /><br /><img border="1" style="margin: 5px" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-package-name.png" /><br /><br />and specify the package name as &quot;sakila&quot;. Click on &quot;Create Persistence Unit ...&quot;.</li>
            <li>Change the default PU name from &quot;SakilaPUPU&quot; to &quot;SakilaPU&quot;:<br /><br /><img border="1" style="margin: 5px" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-create-pu.png" /><br /><br />and click on &quot;Finish&quot;. Notice that &quot;EclipseLink&quot;, the Reference Implementation of JPA 2.0, is used as the persistence library.</li>
            <li>
Add &quot;@javax.persistence.Id&quot; annotation to the following class/field combination:
                <table border="0" width="60%">
                    <tr>
                        <th>Class</th>
                        <th>Field</th>
                    </tr>
                    <tr>
                        <td>sakila.SalesByFilmCategory</td>
                        <td>category</td>
                    </tr>
                    <tr>
                        <td>sakila.ActorInfo</td>
                        <td>actorId</td>
                    </tr>
                    <tr>
                        <td>sakila.FilmList</td>
                        <td>fid</td>
                    </tr>
                    <tr>
                        <td>sakila.CustomerList</td>
                        <td>id</td>
                    </tr>
                    <tr>
                        <td>sakila.NicerButSlowerFilmList</td>
                        <td>fid</td>
                    </tr>
                    <tr>
                        <td>sakila.StaffList</td>
                        <td>id</td>
                    </tr>
                    <tr>
                        <td>sakila.SalesByStore</td>
                        <td>store</td>
                    </tr>
                </table>
<br />This is required because none of the &quot;views&quot; are defined with a primary key.            </li>
            <li>
                <p>Right-click on the project and select &quot;Clean &amp; Build&quot;. This generates &quot;dist/SakilaPU.jar&quot; and the structure looks like:</p>
                <p><img height="530" border="1" style="margin: 5px" width="296" alt="" src="http://blog.arungupta.me/wp-content/uploads/2010/02/totd122-jar-structure.png" /></p>
            </li>
        </ol>
    </li>
</ol>
<p><br /><br />This JAR file can now be included in any web application. The pre-built JAR file can also be <a href="http://blogs.sun.com/arungupta/resource/SakilaPU.jar">downloaded here</a>. The key items to note about this pre-built JAR:</p>
<ul>
    <li>Persistence Unit Name: &quot;SakilaPU&quot;</li>
    <li>All classes are in &quot;sakila.*&quot; package.</li>
    <li>Each class has a pre-defined &quot;&lt;CLASS-NAME&gt;.findAll&quot; named query that returns all elements from the underlying view/table.</li>
    <li>Can be easily added in &quot;WEB-INF/lib&quot; directory of your web application.</li>
</ul>
<p>Even though this blog uses a MySQL sample database, these steps can be easily followed for any other database such as Oracle or JavaDB.</p>
<p><small>Technorati: <a href="http://technorati.com/tags/totd">totd</a> <a href="http://technorati.com/tags/javaee">javaee</a> <a href="http://technorati.com/tags/glassfish">glassfish</a> <a href="http://technorati.com/tags/v3">v3</a> <a href="http://technorati.com/tags/jpa">jpa</a> <a href="http://technorati.com/tags/eclipselink">eclipselink</a> <a href="http://technorati.com/tags/persistenceunit">persistenceunit</a> <a href="http://technorati.com/tags/mysql">mysql</a> <a href="http://technorati.com/tags/sakila">sakila</a> <a href="http://technorati.com/tags/netbeans">netbeans</a></small></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=23404&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=23404&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/02/10/totd-122-creating-a-jpa-persistence-unit-using-netbeans-6-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOTD #121: JDBC resource for MySQL and Oracle sample database in GlassFish v3</title>
		<link>http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-121-jdbc-resource-for-mysql-and-oracle-sample-database-in-glassfish-v3</link>
		<comments>http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for#comments</comments>
		<pubDate>Tue, 09 Feb 2010 07:00:17 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sakila]]></category>
		<category><![CDATA[totd]]></category>
		<category><![CDATA[v3]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for</guid>
		<description><![CDATA[This blog clearly explains how to configure the MySQL sample database (sakila) with GlassFish. Even though the instructions use a specific database but should work for other databases (such as Oracle, JavaDB, PostgreSQL, and others) as well. The second half of the blog provide specific syntax for the Oracle sample database.

    Download sakila sample database and unzip the archive.
    Install the database as described here - basically load and run &#34;sakila-schema.sql&#34; and &#34;sakila-data.sql&#34; extracted from the archive.
    
Create a new MySQL user account using MySQL CLI Admin and assign the privileges
        
            
Using &#34;root&#34; user (sudo mysql --user root)
                
CREATE USER glassfish IDENTIFIED BY 'glassfish';
GRANT ALL PRIVILEGES ON *.* TO 'glassfish'@'localhost' IDENTIFIED BY 'glassfish';
FLUSH PRIVILEGES;

            
            
Using &#34;glassfish&#34; user (sudo mysql --user glassfish)
                
source sakila-schema.sql;
source sakila-data.sql;

            
        
    
    Download Connector/J, unzip and copy &#34;mysql-connector-java-5.x.x-bin.jar&#34; to &#34;glassfish/domains/domain1/lib/ext&#34; directory.
    
Start GlassFish server as:
        
asadmin start-domain


    
    
Create a JDBC resource
        
            
Create JDBC connection pool as:
                
asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype javax.sql.DataSource --property "User=glassfish:Password=glassfish:URL=jdbc\:mysql\://localhost/sakila" jdbc/sakilaPool

            
            
Test the JDBC connection pool as:
                
asadmin ping-connection-pool jdbc/sakilaPool

            
            
Create the JDBC resource as:
                
asadmin create-jdbc-resource --connectionpoolid jdbc/sakilaPool jdbc/sakila

            
        
    

That's it!
Creating a JDBC resource for any other database requires the following updates to the steps mentioned above. Lets consider modifying these steps for the Oracle sample database.

    
Use the client interface SQL*PLus and connect as:         
sqlplus "/ as sysdba"

create user and grant the privileges as:
        
CREATE USER glassfish IDENTIFIED BY glassfish DEFAULT tablespace users TEMPORARY tablespace temp;
GRANT CONNECT TO glassfish IDENTIFIED BY glassfish;
GRANT UNLIMITED TABLESPACE TO glassfish;
GRANT CREATE TABLE TO glassfish;
GRANT CREATE SEQUENCE TO glassfish;

    
    Copy the appropriate JDBC driver (ojdbc6.jar).
    
Create the JDBC resource as:
        
asadmin create-jdbc-connection-pool --datasourceclassname oracle.jdbc.pool.OracleDataSource --restype javax.sql.DataSource --property "User=hr:Password=hr:URL=jdbc\:oracle\:thin\:@localhost\:1521\:orcl" jdbc/hr
asadmin ping-connection-pool jdbc/hr
asadmin create-jdbc-resource --connectionpoolid jdbc/hr jdbc/hr

as explained in TOTD #108.    

Here are a few other related entries:

    
        RESTful representation of sakila using NetBeans and GlassFish
    
    
        JPA + Servlet 3.0 Application using Sakila in Eclipse
    
    
        JSF + JPA + EJB Application using Oracle, NetBeans, and GlassFish
    

Technorati: totd javaee glassfish v3 jpa mysql sakila oracle]]></description>
			<content:encoded><![CDATA[<p>This blog clearly explains how to configure the MySQL sample database (<a href="http://dev.mysql.com/doc/sakila/en/sakila.html">sakila</a>) with <a href="http://glassfish.org">GlassFish</a>. Even though the instructions use a specific database but should work for other databases (such as Oracle, JavaDB, PostgreSQL, and others) as well. The second half of the blog provide specific syntax for the Oracle sample database.</p>
<ol>
    <li>Download <a href="http://downloads.mysql.com/docs/sakila-db.zip">sakila sample database</a> and unzip the archive.</li>
    <li>Install the database as described <a href="http://dev.mysql.com/doc/sakila/en/sakila.html#sakila-installation">here</a> - basically load and run &quot;sakila-schema.sql&quot; and &quot;sakila-data.sql&quot; extracted from the archive.</li>
    <li>
Create a new MySQL user account using MySQL CLI Admin and assign the privileges
        <ol>
            <li>
Using &quot;root&quot; user (sudo mysql --user root)<br />
                <pre>
CREATE USER glassfish IDENTIFIED BY 'glassfish';
GRANT ALL PRIVILEGES ON *.* TO 'glassfish'@'localhost' IDENTIFIED BY 'glassfish';
FLUSH PRIVILEGES;
</pre>
            </li>
            <li>
Using &quot;glassfish&quot; user (sudo mysql --user glassfish)
                <pre>
source sakila-schema.sql;
source sakila-data.sql;
</pre>
            </li>
        </ol>
    </li>
    <li>Download <a href="http://dev.mysql.com/downloads/connector/j/">Connector/J</a>, unzip and copy &quot;mysql-connector-java-5.x.x-bin.jar&quot; to &quot;glassfish/domains/domain1/lib/ext&quot; directory.</li>
    <li>
Start GlassFish server as:
        <pre>
asadmin start-domain

</pre>
    </li>
    <li>
Create a JDBC resource
        <ol>
            <li>
Create JDBC connection pool as:
                <pre>
asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype javax.sql.DataSource --property "User=glassfish:Password=glassfish:URL=jdbc\:mysql\://localhost/sakila" jdbc/sakilaPool
</pre>
            </li>
            <li>
Test the JDBC connection pool as:
                <pre>
asadmin ping-connection-pool jdbc/sakilaPool
</pre>
            </li>
            <li>
Create the JDBC resource as:
                <pre>
asadmin create-jdbc-resource --connectionpoolid jdbc/sakilaPool jdbc/sakila
</pre>
            </li>
        </ol>
    </li>
</ol>
<p>That's it!</p>
<p>Creating a JDBC resource for any other database requires the following updates to the steps mentioned above. Lets consider modifying these steps for the Oracle sample database.</p>
<ol>
    <li>
Use the client interface SQL*PLus and connect as:<br />         <pre>
sqlplus "/ as sysdba"
</pre>
<br />create user and grant the privileges as:<br />
        <pre>
CREATE USER glassfish IDENTIFIED BY glassfish DEFAULT tablespace users TEMPORARY tablespace temp;
GRANT CONNECT TO glassfish IDENTIFIED BY glassfish;
GRANT UNLIMITED TABLESPACE TO glassfish;
GRANT CREATE TABLE TO glassfish;
GRANT CREATE SEQUENCE TO glassfish;
</pre>
    </li>
    <li>Copy the appropriate JDBC driver (<a href="http://download.oracle.com/otn/utilities_drivers/jdbc/112/ojdbc6.jar">ojdbc6.jar</a>).</li>
    <li>
Create the JDBC resource as:<br />
        <pre>
asadmin create-jdbc-connection-pool --datasourceclassname oracle.jdbc.pool.OracleDataSource --restype javax.sql.DataSource --property "User=hr:Password=hr:URL=jdbc\:oracle\:thin\:@localhost\:1521\:orcl" jdbc/hr
asadmin ping-connection-pool jdbc/hr
asadmin create-jdbc-resource --connectionpoolid jdbc/hr jdbc/hr
</pre>
<br />as explained in <a href="http://blogs.sun.com/arungupta/entry/totd_108_java_ee_6">TOTD #108</a>.    </li>
</ol>
<p>Here are a few other related entries:</p>
<ul>
    <li>
        <p><a href="http://blogs.sun.com/arungupta/entry/restful_representation_of_sakila_using">RESTful representation of sakila using NetBeans and GlassFish</a></p>
    </li>
    <li>
        <p><a href="http://blogs.sun.com/arungupta/entry/totd_99_creating_a_java">JPA + Servlet 3.0 Application using Sakila in Eclipse</a></p>
    </li>
    <li>
        <p><a href="http://blogs.sun.com/arungupta/entry/totd_108_java_ee_6">JSF + JPA + EJB Application using Oracle, NetBeans, and GlassFish</a></p>
    </li>
</ul>
<p><small>Technorati: <a href="http://technorati.com/tags/totd">totd</a> <a href="http://technorati.com/tags/javaee">javaee</a> <a href="http://technorati.com/tags/glassfish">glassfish</a> <a href="http://technorati.com/tags/v3">v3</a> <a href="http://technorati.com/tags/jpa">jpa</a> <a href="http://technorati.com/tags/mysql">mysql</a> <a href="http://technorati.com/tags/sakila">sakila</a> <a href="http://technorati.com/tags/oracle">oracle</a></small></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=23392&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=23392&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/02/09/totd-121-jdbc-resource-for-mysql-and-oracle-sample-database-in-glassfish-v3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOTD #109: How to convert a JSF managed bean to JSR 299 bean (Web Beans) ?</title>
		<link>http://blogs.sun.com/arungupta/entry/totd_109_how_to_convert?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-109-how-to-convert-a-jsf-managed-bean-to-jsr-299-bean-web-beans</link>
		<comments>http://blogs.sun.com/arungupta/entry/totd_109_how_to_convert#comments</comments>
		<pubDate>Fri, 02 Oct 2009 22:40:00 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[javaee6]]></category>
		<category><![CDATA[javaserverfaces]]></category>
		<category><![CDATA[jsr299]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[totd]]></category>
		<category><![CDATA[v3]]></category>
		<category><![CDATA[webbeans]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/totd_109_how_to_convert</guid>
		<description><![CDATA[Content available at http://blog.arungupta.me/2009/10/totd-109-how-to-convert-a-jsf-managed-bean-to-jsr-299-bean-web-beans/.]]></description>
			<content:encoded><![CDATA[Content available at <a href="http://blog.arungupta.me/2009/10/totd-109-how-to-convert-a-jsf-managed-bean-to-jsr-299-bean-web-beans/" />http://blog.arungupta.me/2009/10/totd-109-how-to-convert-a-jsf-managed-bean-to-jsr-299-bean-web-beans/</>.<br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=21429&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=21429&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2009/10/03/totd-109-how-to-convert-a-jsf-managed-bean-to-jsr-299-bean-web-beans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOTD #95: EJB 3.1 + Java Server Faces 2.0 + JPA 2.0 web application &#8212; Getting Started with Java EE 6 using NetBeans 6.8 M1 &amp; GlassFish v3</title>
		<link>http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-95-ejb-3-1-java-server-faces-2-0-jpa-2-0-web-application-getting-started-with-java-ee-6-using-netbeans-6-8-m1-glassfish-v3</link>
		<comments>http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1#comments</comments>
		<pubDate>Mon, 17 Aug 2009 10:00:00 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[ejb]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[javaee6]]></category>
		<category><![CDATA[javaserverfaces]]></category>
		<category><![CDATA[jpa2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[totd]]></category>
		<category><![CDATA[v3]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1</guid>
		<description><![CDATA[
TOTD
#93
showed how to get started with Java EE 6
using NetBeans
6.8 M1 and
GlassFish v3 by
building a simple Servlet 3.0 + JPA 2.0 web
application. TOTD
#94 built upon it by using Java Server Faces 2 instead of
Servlet 3.0 for displaying the results. However we are still using a
POJO
for all the database interactions. This works fine if we are only
reading values from the database but that's not how a typical web
application behaves. The web application would typically perform all
CRUD operations. More typically they like to perform one or more CRUD
operations within the context of a transaction. And how do you do
transactions in the context of a web application ? Java EE 6 comes to
your rescue.

The EJB 3.1
specification (another new specification in Java EE 6) allow
POJO classes to be annotated with @EJB and bundled within
WEB-INF/classes of a WAR file. And so you get all transactional
capabilities in your web application very easily.

This&#160;Tip
Of The Day (TOTD) shows how
to enhance the application created in TOTD #94 and use EJB 3.1 instead
of the JSF managed bean
for
performing the business logic. There are two ways to achieve this
pattern as described below.

Lets call this TOTD #95.1

  The easiest way to back a JSF page with an EJB is to
convert the managed bean into an EJB by adding @javax.ejb.Stateless
annotation. So change the&#160; "StateList" class from TOTD #94 as
shown below:
    
    
      
        
          @javax.ejb.Stateless
@ManagedBean
public class StateList {
&#160;&#160;&#160; @PersistenceUnit
&#160;&#160;&#160; EntityManagerFactory emf;
          
&#160;&#160;&#160; public List&#60;States&#62;
getStates() {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;
return
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();
&#160;&#160;&#160; }
}
        
      
    
    
The change is highlighted in bold, and that's it!

Because of "Deploy-on-save" feature in NetBeans and GlassFish v3, the
application is autodeployed. Otherwise right-click on the project and
select Run (default shortcut "F6"). As earlier, the results can be seen
at "http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" or
"http://localhost:8080/HelloEclipseLink/faces/template-client.xhtml"
and looks like:



The big difference this time is that the business logic is executed by
an EJB in a fully transactional manner. Even though the logic in this
case is a single read-only operation to the database, but you get the
idea :)

Alternatively, you can use the delegate pattern in the managed bean as
described below. Lets call this #95.2.

  Right-click on the project, select "New", "Session Bean
..." and create a stateless session bean by selecting the options as
shown below:
    
    
    
This creates a stateless session with the name "StateBeanBean" (bug
#170392 for redundant "Bean" in the name).
  Simplify your managed bean by refactoring all the business
logic to the EJB as shown below:
    
    
      
        
          @Stateless
public class StateBeanBean {
&#160;&#160;&#160; @PersistenceUnit
&#160;&#160;&#160; EntityManagerFactory emf;
&#160;&#160; &#160;
&#160;&#160;&#160; public List&#60;States&#62;
getStates() {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;
return
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();
&#160;&#160;&#160; }
}
        
      
    
    
and 
    
    
      
        
          @ManagedBean
public class StateList {
&#160;&#160;&#160; @EJB StateBeanBean bean;
          
&#160;&#160;&#160; public List&#60;States&#62;
getStates() {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;
return bean.getStates();
&#160;&#160;&#160; }
}
          
        
      
    
    
In fact the EJB code can be further simplified to:
    
    
      
        
          @Stateless
public class StateBeanBean {
&#160;&#160;&#160; @PersistenceContext
          &#160;&#160;&#160;
EntityManager em;
&#160;&#160;&#160; 
&#160;&#160;&#160; public List&#60;States&#62;
getStates() {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;
return em.createNamedQuery("States.findAll").getResultList();
&#160;&#160;&#160; }
}
          
        
      
    
    
The changes are highlighted in bold.
  

If the application is already running then Deploy-on-Save
would have automatically deployed the entire application. Otherwise
right-click on the project and select Run (default shortcut "F6").
Again, the
results can be seen at
"http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" or
"http://localhost:8080/HelloEclipseLink/faces/template-client.xhtml"
and are displayed as shown in the screenshot above.

The updated directory structure looks like:



The important point to note is that our EJB is bundled in the WAR file
and no additional deployment descriptors were added or existing ones
modified to achieve that. Now, that's really clean :)

The next blog in this series will show how managed beans can be
replaced with WebBeans, err JCDI.

Also refer to other Java EE 6
blog entries. 

Please leave suggestions on other TOTD that
you'd like to see.
A complete archive of all the tips is available here.


Technorati: totd
glassfish
v3 mysql javaee6 javaserverfaces
jpa2 ejb netbeans
]]></description>
			<content:encoded><![CDATA[<br>
<a href="http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with">TOTD
#93</a>
showed how to get started with <a href="http://jcp.org/en/jsr/detail?id=316">Java EE 6</a>
using <a href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1413">NetBeans
6.8 M1</a> and
<a href="http://glassfish.org">GlassFish v3</a> by
building a simple Servlet 3.0 + JPA 2.0 web
application. <a href="http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java">TOTD
#94</a> built upon it by using Java Server Faces 2 instead of
Servlet 3.0 for displaying the results. However we are still using a
POJO
for all the database interactions. This works fine if we are only
reading values from the database but that's not how a typical web
application behaves. The web application would typically perform all
CRUD operations. More typically they like to perform one or more CRUD
operations within the context of a transaction. And how do you do
transactions in the context of a web application ? Java EE 6 comes to
your rescue.<br>
<br>
The <a href="http://jcp.org/en/jsr/detail?id=318">EJB 3.1
specification</a> (another new specification in Java EE 6) allow
POJO classes to be annotated with @EJB and bundled within
WEB-INF/classes of a WAR file. And so you get all transactional
capabilities in your web application very easily.<br>
<br>
This&nbsp;<span>T</span>ip
<span>O</span>f <span>T</span>he <span>D</span>ay (TOTD) shows how
to enhance the application created in TOTD #94 and use EJB 3.1 instead
of the JSF <span>managed bean</span>
for
performing the business logic. There are two ways to achieve this
pattern as described below.<br>
<br>
Lets call this TOTD #95.1<br>
<ol>
  <li>The easiest way to back a JSF page with an EJB is to
convert the managed bean into an EJB by adding @javax.ejb.Stateless
annotation. So change the&nbsp; "StateList" class from TOTD #94 as
shown below:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td><span>@javax.ejb.Stateless</span><br>
@ManagedBean<br>
public class StateList {<br>
&nbsp;&nbsp;&nbsp; @PersistenceUnit<br>
&nbsp;&nbsp;&nbsp; EntityManagerFactory emf;<br>
          <br>
&nbsp;&nbsp;&nbsp; public List&lt;States&gt;
getStates() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();<br>
&nbsp;&nbsp;&nbsp; }<br>
}</td>
        </tr>
      </tbody>
    </table>
    <br>
The change is highlighted in bold, and that's it!</li>
</ol>
Because of "Deploy-on-save" feature in NetBeans and GlassFish v3, the
application is autodeployed. Otherwise right-click on the project and
select Run (default shortcut "F6"). As earlier, the results can be seen
at "http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" or
"http://localhost:8080/HelloEclipseLink/faces/template-client.xhtml"
and looks like:<br>
<br>
<img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-ejb-1st-output.png" /><br>
<br>
The big difference this time is that the business logic is executed by
an EJB in a fully transactional manner. Even though the logic in this
case is a single read-only operation to the database, but you get the
idea :)<br>
<br>
Alternatively, you can use the delegate pattern in the <span>managed bean</span> as
described below. Lets call this #95.2.
<ol>
  <li>Right-click on the project, select "New", "Session Bean
..." and create a stateless session bean by selecting the options as
shown below:<br>
    <br>
    <span><img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-ejb-create.png" /></span><br>
    <br>
This creates a stateless session with the name "StateBeanBean" (<a href="http://www.netbeans.org/issues/show_bug.cgi?id=170392">bug
#170392</a> for redundant "Bean" in the name).</li>
  <li>Simplify your managed bean by refactoring all the business
logic to the EJB as shown below:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>@Stateless<br>
public class StateBeanBean {<br>
&nbsp;&nbsp;&nbsp; @PersistenceUnit<br>
&nbsp;&nbsp;&nbsp; EntityManagerFactory emf;<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp;&nbsp; public List&lt;States&gt;
getStates() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();<br>
&nbsp;&nbsp;&nbsp; }<br>
}</td>
        </tr>
      </tbody>
    </table>
    <br>
and <br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>@ManagedBean<br>
public class StateList {<br>
&nbsp;&nbsp;&nbsp; @EJB StateBeanBean bean;<br>
          <br>
&nbsp;&nbsp;&nbsp; public List&lt;States&gt;
getStates() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return bean.getStates();<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
          <span></span></td>
        </tr>
      </tbody>
    </table>
    <br>
In fact the EJB code can be further simplified to:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>@Stateless<br>
public class StateBeanBean {<br>
&nbsp;&nbsp;&nbsp; <span>@PersistenceContext</span><br>
          <span>&nbsp;&nbsp;&nbsp;
EntityManager em;</span><br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; public List&lt;States&gt;
getStates() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return <span>em.</span>createNamedQuery("States.findAll").getResultList();<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
          <span></span></td>
        </tr>
      </tbody>
    </table>
    <br>
The changes are highlighted in bold.<br>
  </li>
</ol>
If the application is already running then <span>Deploy-on-Save</span>
would have automatically deployed the entire application. Otherwise
right-click on the project and select Run (default shortcut "F6").
Again, the
results can be seen at
"http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" or
"http://localhost:8080/HelloEclipseLink/faces/template-client.xhtml"
and are displayed as shown in the screenshot above.<br>
<br>
The updated directory structure looks like:<br>
<br>
<img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-ejb-dir-structure.png" /><br>
<br>
The important point to note is that our EJB is bundled in the WAR file
and no additional deployment descriptors were added or existing ones
modified to achieve that. Now, that's really clean :)<br>
<br>
The next blog in this series will show how managed beans can be
replaced with WebBeans, err JCDI.<br>
<br>
Also refer to other <a href="http://blogs.sun.com/arungupta/tags/javaee6">Java EE 6
blog entries</a>. <br>
<br>
Please leave suggestions on other TOTD that
you'd like to see.
A complete archive of all the tips is available <a href="http://blogs.sun.com/arungupta/tags/totd">here</a>.
<br>
<br>
<small>Technorati: <a href="http://technorati.com/tags/totd">totd</a>
<a href="http://technorati.com/tags/glassfish">glassfish</a>
<a href="http://technorati.com/tags/v3">v3</a> <a href="http://technorati.com/tags/mysql">mysql</a> <a href="http://technorati.com/tags/javaee6">javaee6</a> <a href="http://technorati.com/tags/javaserverfaces">javaserverfaces</a>
<a href="http://technorati.com/tags/jpa2">jpa2</a> <a href="http://technorati.com/tags/ejb">ejb</a> <a href="http://technorati.com/tags/netbeans">netbeans</a></small>
<br><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20667&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20667&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2009/08/17/totd-95-ejb-3-1-java-server-faces-2-0-jpa-2-0-web-application-getting-started-with-java-ee-6-using-netbeans-6-8-m1-glassfish-v3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOTD #94: A simple Java Server Faces 2.0 + JPA 2.0 application &#8212; Getting Started with Java EE 6 using NetBeans 6.8 M1 &amp; GlassFish v3</title>
		<link>http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-94-a-simple-java-server-faces-2-0-jpa-2-0-application-getting-started-with-java-ee-6-using-netbeans-6-8-m1-glassfish-v3</link>
		<comments>http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java#comments</comments>
		<pubDate>Fri, 14 Aug 2009 10:00:00 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[javaee6]]></category>
		<category><![CDATA[javaserverfaces]]></category>
		<category><![CDATA[jpa2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[totd]]></category>
		<category><![CDATA[v3]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java</guid>
		<description><![CDATA[
TOTD
#93
showed how to get started with Java EE 6
using NetBeans
6.8 M1 and
GlassFish v3 by
building a simple Servlet 3.0 + JPA 2.0 web
application. JPA 2.0 + Eclipselink was used for the database
connectivity
and Servlet 3.0 was used for displaying the results to the user. The
sample demonstrated how the two technologies can be mixed to create a
simple web application. But Servlets are meant for server-side
processing rather than displaying the results to end user. JavaServer
Faces 2 (another new specification in Java EE 6) is designed
to fulfill
that purpose.

This&#160;Tip
Of The Day (TOTD) shows how
to enhance the application created in TOTD #93 and use JSF 2 for
displaying the results.

  Right-click on the project, select "Properties", select
"Frameworks", click on "Add ..." as shown below:
    
    
    
Select "JavaServer Faces" and click on "OK". The following
configuration screen is shown:
    
    
    
Click on "OK" to complete the dialog. This generates a whole bunch of
files (7 to be accurate) in your project. Most of these files are
leftover from previous version of NetBeans and will be cleaned up. For
example, "faces-config.xml" is now optional and "forwardToJSF.jsp" is
redundant.
  Anyway, lets add a POJO class that will be our managed bean.
Right-click on "server" package and select "New", "Java Class ...",
give the name as "StateList". Change the class such that it looks like:
    
    
      
        
          package server;
          
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceUnit;
import states.States;
          
/**
&#160;* @author arungupta
&#160;*/
@ManagedBean
public class StateList {
&#160;&#160;&#160; @PersistenceUnit
&#160;&#160;&#160; EntityManagerFactory emf;
          
&#160;&#160;&#160; public List&#60;States&#62;
getStates() {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;
return
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();
&#160;&#160;&#160; }
}
        
      
    
    
Here are the main characterisitcs of this class:
  
  
    This is a POJO class with @ManagedBean annotation. This
annotation makes this class a managed
bean that can be used in the JSF pages. As no other
annotations or parameters are specified, this is a request-scoped
managed bean with the name "stateList" and lazily initialized. More
details about this annotation are available in the javadocs.
    The persistence unit created in TOTD
#93 is injected using @PersistenceUnit annotation.
    The POJO has one getter method that queries the database
and return the list of all the states.
    
  
  In the generated file "template-client.xhtml", change the
"head" template to:
    
    
      
        
          Show States
          
        
      
    
    
and "body" template to:
    
    
      
        
          &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#60;h:dataTable var="state" value="#{stateList.states}"
border="1"&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#60;h:column&#62;&#60;h:outputText
value="#{state.abbrev}"/&#62;&#60;/h:column&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#60;h:column&#62;&#60;h:outputText
value="#{state.name}"/&#62;&#60;/h:column&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#60;/h:dataTable&#62;
          
        
      
    
  
  
This uses the standard JSF "dataTable", "column", and "outputText" tags
and uses the value
expression to fetch the values from the managed bean.
  

If the application is already running from&#160;TOTD
#93, then Deploy-on-Save
would have automatically deployed the entire application. Otherwise
right-click on the project and select Run (default shortcut "F6"). The
results can be seen at
"http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" or
"http://localhost:8080/HelloEclipseLink/faces/template-client.xhtml"
and looks like:



The updated directory structure looks like:



There were multiple files added by the JSF framework support in
NetBeans. But as I said earlier, they will be cleaned up before the
final release.

Also refer to other Java EE 6
blog entries. 

Please leave suggestions on other TOTD that
you'd like to see.
A complete archive of all the tips is available here.


Technorati: totd
glassfish
v3 mysql javaee6 javaserverfaces
jpa2 netbeans

]]></description>
			<content:encoded><![CDATA[<br>
<a href="http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with">TOTD
#93</a>
showed how to get started with <a href="http://jcp.org/en/jsr/detail?id=316">Java EE 6</a>
using <a href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1413">NetBeans
6.8 M1</a> and
<a href="http://glassfish.org">GlassFish v3</a> by
building a simple Servlet 3.0 + JPA 2.0 web
application. JPA 2.0 + Eclipselink was used for the database
connectivity
and Servlet 3.0 was used for displaying the results to the user. The
sample demonstrated how the two technologies can be mixed to create a
simple web application. But Servlets are meant for server-side
processing rather than displaying the results to end user. <a href="http://jcp.org/en/jsr/detail?id=314">JavaServer
Faces 2</a> (another new specification in Java EE 6) is designed
to fulfill
that purpose.<br>
<br>
This&nbsp;<span>T</span>ip
<span>O</span>f <span>T</span>he <span>D</span>ay (TOTD) shows how
to enhance the application created in TOTD #93 and use JSF 2 for
displaying the results.<br>
<ol>
  <li>Right-click on the project, select "Properties", select
"Frameworks", click on "Add ..." as shown below:<br>
    <br>
    <a href="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-jsf2-add-framework.png"><img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-jsf2-add-framework.png" /></a><br>
    <br>
Select "JavaServer Faces" and click on "OK". The following
configuration screen is shown:<br>
    <br>
    <a href="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-jsf2-framework-added.png"><img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-jsf2-framework-added.png" /></a><br>
    <br>
Click on "OK" to complete the dialog. This generates a whole bunch of
files (7 to be accurate) in your project. Most of these files are
leftover from previous version of NetBeans and will be cleaned up. For
example, "faces-config.xml" is now optional and "forwardToJSF.jsp" is
redundant.</li>
  <li>Anyway, lets add a POJO class that will be our <span>managed bean</span>.
Right-click on "server" package and select "New", "Java Class ...",
give the name as "StateList". Change the class such that it looks like:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>package server;<br>
          <br>
import java.util.List;<br>
import javax.faces.bean.ManagedBean;<br>
import javax.persistence.EntityManagerFactory;<br>
import javax.persistence.PersistenceUnit;<br>
import states.States;<br>
          <br>
/**<br>
&nbsp;* @author arungupta<br>
&nbsp;*/<br>
@ManagedBean<br>
public class StateList {<br>
&nbsp;&nbsp;&nbsp; @PersistenceUnit<br>
&nbsp;&nbsp;&nbsp; EntityManagerFactory emf;<br>
          <br>
&nbsp;&nbsp;&nbsp; public List&lt;States&gt;
getStates() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();<br>
&nbsp;&nbsp;&nbsp; }<br>
}</td>
        </tr>
      </tbody>
    </table>
    <br>
Here are the main characterisitcs of this class:<br>
  </li>
  <ol>
    <li>This is a POJO class with @ManagedBean annotation. This
annotation makes this class a <span>managed
bean</span> that can be used in the JSF pages. As no other
annotations or parameters are specified, this is a request-scoped
managed bean with the name "stateList" and lazily initialized. More
details about this annotation are available in the <a href="https://javaserverfaces.dev.java.net/nonav/docs/2.0/managed-bean-javadocs/index.html">javadocs</a>.</li>
    <li>The persistence unit created in <a href="http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with">TOTD
#93</a> is injected using @PersistenceUnit annotation.</li>
    <li>The POJO has one getter method that queries the database
and return the list of all the states.<br>
    </li>
  </ol>
  <li>In the generated file "template-client.xhtml", change the
"head" template to:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>Show States<br>
          <span></span></td>
        </tr>
      </tbody>
    </table>
    <br>
and "body" template to:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;h:dataTable var="state" value="#{stateList.states}"
border="1"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;h:column&gt;&lt;h:outputText
value="#{state.abbrev}"/&gt;&lt;/h:column&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;h:column&gt;&lt;h:outputText
value="#{state.name}"/&gt;&lt;/h:column&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/h:dataTable&gt;<br>
          <span></span></td>
        </tr>
      </tbody>
    </table>
  </li>
  <br>
This uses the standard JSF "dataTable", "column", and "outputText" tags
and uses the <span>value
expression</span> to fetch the values from the <span>managed bean</span>.<br>
  <br>
</ol>
If the application is already running from&nbsp;<a href="http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with">TOTD
#93</a>, then <span>Deploy-on-Save</span>
would have automatically deployed the entire application. Otherwise
right-click on the project and select Run (default shortcut "F6"). The
results can be seen at
"http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" or
"http://localhost:8080/HelloEclipseLink/faces/template-client.xhtml"
and looks like:<br>
<br>
<img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-jsf2-output.png" /><br>
<br>
The updated directory structure looks like:<br>
<br>
<img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jee6-jsf2-dir-structure.png" /><br>
<br>
There were multiple files added by the JSF framework support in
NetBeans. But as I said earlier, they will be cleaned up before the
final release.<br>
<br>
Also refer to other <a href="http://blogs.sun.com/arungupta/tags/javaee6">Java EE 6
blog entries</a>. <br>
<br>
Please leave suggestions on other TOTD that
you'd like to see.
A complete archive of all the tips is available <a href="http://blogs.sun.com/arungupta/tags/totd">here</a>.
<br>
<br>
<small>Technorati: <a href="http://technorati.com/tags/totd">totd</a>
<a href="http://technorati.com/tags/glassfish">glassfish</a>
<a href="http://technorati.com/tags/v3">v3</a> <a href="http://technorati.com/tags/mysql">mysql</a> <a href="http://technorati.com/tags/javaee6">javaee6</a> <a href="http://technorati.com/tags/javaserverfaces">javaserverfaces</a>
<a href="http://technorati.com/tags/jpa2">jpa2</a> <a href="http://technorati.com/tags/netbeans">netbeans</a></small>
<br>
<br><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20638&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20638&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2009/08/14/totd-94-a-simple-java-server-faces-2-0-jpa-2-0-application-getting-started-with-java-ee-6-using-netbeans-6-8-m1-glassfish-v3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOTD #93: Getting Started with Java EE 6 using NetBeans 6.8 M1 &amp; GlassFish v3 &#8212; A simple Servlet 3.0 + JPA 2.0 app</title>
		<link>http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=totd-93-getting-started-with-java-ee-6-using-netbeans-6-8-m1-glassfish-v3-a-simple-servlet-3-0-jpa-2-0-app</link>
		<comments>http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with#comments</comments>
		<pubDate>Thu, 13 Aug 2009 10:00:00 +0000</pubDate>
		<dc:creator>Arun Gupta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[javaee6]]></category>
		<category><![CDATA[jpa2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[servlet3]]></category>
		<category><![CDATA[totd]]></category>
		<category><![CDATA[v3]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with</guid>
		<description><![CDATA[
NetBeans
6.8 M1 introduces support for creating Java EE 6 applications
... cool!

This Tip Of The Day (TOTD) shows how
to create a simple web application using JPA 2.0 and Servlet 3.0 and
deploy on GlassFish v3 latest
promoted build (58
as of this writing). If you can work with the one week older build then
NetBeans 6.8 M1 comes pre-bundled with 57. The example below should
work fine on that as well.

  Create the database, table, and populate some data into it
as shown below:
    
    
      
        
          ~/tools/glassfish/v3/58/glassfishv3/bin&#160;&#62;sudo mysql --user root
Password:
Welcome to the MySQL monitor.&#160; Commands end with ; or \g.
Your MySQL connection id is 1592
Server version: 5.1.30 MySQL Community Server (GPL)
          
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
          
mysql&#62; create
database states;
Query OK, 1 row affected (0.02 sec)
          
mysql&#62; CREATE
USER duke IDENTIFIED by 'glassfish';
Query OK, 0 rows affected (0.00 sec)
          
mysql&#62; GRANT ALL
on states.* TO duke;
Query OK, 0 rows affected (0.24 sec)
          
mysql&#62; use states;
          Database changed
          
mysql&#62; CREATE
TABLE STATES (
          &#160;&#160;&#160;
-&#62;&#160;&#160;&#160;&#160;&#160;&#160;
id INT,
          &#160;&#160;&#160;
-&#62;&#160;&#160;&#160;&#160;&#160;&#160;
abbrev VARCHAR(2),
          &#160;&#160;&#160;
-&#62;&#160;&#160;&#160;&#160;&#160;&#160;
name VARCHAR(50),
          &#160;&#160;&#160;
-&#62;&#160;&#160;&#160;&#160;&#160;&#160;
PRIMARY KEY (id)
          &#160;&#160;&#160;
-&#62; );
Query OK, 0 rows affected (0.16 sec)
          
mysql&#62; INSERT
INTO STATES VALUES (1, "AL", "Alabama");
          INSERT INTO
STATES VALUES (2, "AK", "Alaska");
          
. . .
          
mysql&#62; INSERT
INTO STATES VALUES (49, "WI", "Wisconsin");
Query OK, 1 row affected (0.00 sec)
          
mysql&#62; INSERT
INTO STATES VALUES (50, "WY", "Wyoming");
Query OK, 1 row affected (0.00 sec)
        
      
    
    
The complete INSERT statement is available in TOTD
#38. Most of this step can be executed from within the IDE as
well as explained in TOTD
#38. 
  Download and unzip GlassFish v3 build
58. Copy the latest MySQL
Connector/J
jar in "domains/domain1/lib" directory of GlassFish and start the
application server
as:
    
    
      
        
          ~/tools/glassfish/v3/58/glassfishv3/bin &#62;asadmin start-domain
        
      
    
  
  Create JDBC connection pool and JNDI resource as shown
below:
    
    
      
        
          ~/tools/glassfish/v3/58/glassfishv3/bin &#62;./asadmin
create-jdbc-connection-pool --datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype
javax.sql.DataSource --property
"User=duke:Password=glassfish:URL=jdbc\:mysql\://localhost/states"
jdbc/states
          
Command create-jdbc-connection-pool executed successfully.
~/tools/glassfish/v3/58/glassfishv3/bin &#62;./asadmin ping-connection-pool
jdbc/states
          
Command ping-connection-pool executed successfully.
~/tools/glassfish/v3/58/glassfishv3/bin &#62;./asadmin create-jdbc-resource
--connectionpoolid jdbc/states jdbc/jndi_states
          
Command create-jdbc-resource executed successfully.
        
      
    
    
  
  Download NetBeans
6.8 M1 and install "All" version. Expand "Servers" node and
add the recently installed GlassFish server.
  Create a new Web project and name it "HelloEclipseLink".
Make sure to choose "GlassFish v3" as the server and "Java EE 6 Web" as
the Java EE version as shown below:
    
    
    
Take defaults elsewhere.
  Create the Persistence Unit
  
    Right-click on the newly created project and select
"New", "Entity Classes from Database ...". Choose the earlier created
data source "jdbc/jndi_states" as shown below:
      
      
    Select "STATES" table in "Available Tables:" and click on
"Add &#62;" and then "Next &#62;".
    Click on "Create Persistence Unit ...", take all the
defaults and click on "Create". "EclipseLink" is the Reference
Implementation for JPA 2.0 is the default choosen Persistence Provider
as shown below:
      
      
    Enter the package name as "server" and click on "Finish".
  
  Create a Servlet to retrieve and display all the
information from the database
  
    Right click on the project, "New", "Servlet ...".
    Give the Servlet name "ShowStates" and package "server".
    Even
though you can take all the defaults and click on "Finish" but instead
click on "Next &#62;" and the following screen is shown:
      
      
      
Notice
"Add information to deployment descriptor (web.xml)" checkbox. Servlet
3.0 makes "web.xml" optional in most of the common cases by providing
corresponding annotations and NetBeans 6.8 leverages that
functionality. As a result, no "web.xml" will be bundled in our WAR
file. Click on "Finish" now.
      
The generated servlet code looks like:
      
      
      
Notice @WebServlet annotation, this makes "web.xml" optional. TOTD
#82 provide another example on how to use Servlet 3.0 with
EJB 3.1.
    Inject the Persistence Unit as:
      
      
        
          
            &#160;&#160;&#160; @PersistenceUnit
&#160;&#160;&#160; EntityManagerFactory emf;
          
        
      
      
right above "processRequest" method.
    Change the "try" block of "processRequest" method to:
      
      
        
          
            &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
List&#60;States&#62; list =
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
out.println("&#60;table border=\"1\"&#62;");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
for (States state : list) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
out.println("&#60;tr&#62;&#60;td&#62;" + state.getAbbrev() +
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
"&#60;/td&#62;&#60;td&#62;" + state.getName() +
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
"&#60;/td&#62;&#60;/tr&#62;");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
out.println("&#60;/table&#62;");
          
        
      
      
This uses a predefined query to retrieve all rows from the table and
then display them in a simple formatted HTML table.
  
  Run the project
  
  
  
    Right click on the project, select "Properties" and
change the "Relative URL" to "/ShowStates". This is the exact URL that
you specified earlier.
      
      
    Right-click on the project and select "Run" to see the
following output:
      
      
      
    
  

So we created a simple web application that uses Servlet 3.0, JPA 2.0,
EclipseLink and deployed on GlassFish v3 using NetBeans 6.8 M1.
NetBeans provides reasonable defaults making you a lazy programmer.
Believe this is more evident when you start playing with Java EE
support in other IDEs ;-)

Finally, lets look at the structure of the generated WAR file:



It's very clean - no "web.xml", only the relevant classes and
"persistence.xml".

Also refer to other Java EE 6
blog entries. A future blog entry will show how to use JSF
2.0 instead of Servlet for displaying the results.

Please leave suggestions on other TOTD that
you'd like to see.
A complete archive of all the tips is available here.


Technorati: totd
glassfish
v3 mysql javaee6 servlet3
jpa2 netbeans]]></description>
			<content:encoded><![CDATA[<br>
<a href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1413">NetBeans
6.8 M1</a> introduces support for creating Java EE 6 applications
... cool!<br>
<br>
This <span>T</span>ip <span>O</span>f <span>T</span>he <span>D</span>ay (TOTD) shows how
to create a simple web application using JPA 2.0 and Servlet 3.0 and
deploy on GlassFish v3 <a href="http://download.java.net/glassfish/v3/promoted/">latest
promoted build</a> (<a href="http://download.java.net/glassfish/v3/promoted/glassfish-v3-preview-b58.zip">58</a>
as of this writing). If you can work with the one week older build then
NetBeans 6.8 M1 comes pre-bundled with 57. The example below should
work fine on that as well.<br>
<ol>
  <li>Create the database, table, and populate some data into it
as shown below:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>~/tools/glassfish/v3/58/glassfishv3/bin&nbsp;&gt;<span>sudo mysql --user root</span><br>
Password:<br>
Welcome to the MySQL monitor.&nbsp; Commands end with ; or \g.<br>
Your MySQL connection id is 1592<br>
Server version: 5.1.30 MySQL Community Server (GPL)<br>
          <br>
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br>
          <br>
mysql&gt; <span>create
database states;</span><br>
Query OK, 1 row affected (0.02 sec)<br>
          <br>
mysql&gt; <span>CREATE
USER duke IDENTIFIED by 'glassfish';</span><br>
Query OK, 0 rows affected (0.00 sec)<br>
          <br>
mysql&gt; <span>GRANT ALL
on states.* TO duke;</span><br>
Query OK, 0 rows affected (0.24 sec)<br>
          <br>
mysql&gt; <span>use states;</span><br>
          <span>Database changed</span><br>
          <br>
mysql&gt; <span>CREATE
TABLE STATES (</span><br>
          <span>&nbsp;&nbsp;&nbsp;
-&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
id INT,</span><br>
          <span>&nbsp;&nbsp;&nbsp;
-&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
abbrev VARCHAR(2),</span><br>
          <span>&nbsp;&nbsp;&nbsp;
-&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
name VARCHAR(50),</span><br>
          <span>&nbsp;&nbsp;&nbsp;
-&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PRIMARY KEY (id)</span><br>
          <span>&nbsp;&nbsp;&nbsp;
-&gt; );</span><br>
Query OK, 0 rows affected (0.16 sec)<br>
          <br>
mysql&gt; <span>INSERT
INTO STATES VALUES (1, "AL", "Alabama");</span><br>
          <span>INSERT INTO
STATES VALUES (2, "AK", "Alaska");</span><br>
          <br>
. . .<br>
          <br>
mysql&gt; <span>INSERT
INTO STATES VALUES (49, "WI", "Wisconsin");</span><br>
Query OK, 1 row affected (0.00 sec)<br>
          <br>
mysql&gt; <span>INSERT
INTO STATES VALUES (50, "WY", "Wyoming");</span><br>
Query OK, 1 row affected (0.00 sec)</td>
        </tr>
      </tbody>
    </table>
    <br>
The complete INSERT statement is available in <a href="http://blogs.sun.com/arungupta/entry/totd_38_creating_a_mysql">TOTD
#38</a>. Most of this step can be executed from within the IDE as
well as explained in <a href="http://blogs.sun.com/arungupta/entry/totd_38_creating_a_mysql">TOTD
#38</a>. </li>
  <li>Download and unzip GlassFish v3 <a href="http://download.java.net/glassfish/v3/promoted/glassfish-v3-preview-b58.zip">build
58</a>. Copy the latest <a href="http://dev.mysql.com/downloads/connector/j/5.1.html">MySQL
Connector/J</a>
jar in "domains/domain1/lib" directory of GlassFish and start the
application server
as:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>~/tools/glassfish/v3/58/glassfishv3/bin &gt;<span>asadmin start-domain</span></td>
        </tr>
      </tbody>
    </table>
  </li>
  <li>Create JDBC connection pool and JNDI resource as shown
below:<br>
    <br>
    <table
 cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td>~/tools/glassfish/v3/58/glassfishv3/bin &gt;<span>./asadmin
create-jdbc-connection-pool --datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype
javax.sql.DataSource --property
"User=duke:Password=glassfish:URL=jdbc\:mysql\://localhost/states"
jdbc/states</span><br>
          <br>
Command create-jdbc-connection-pool executed successfully.<br>
~/tools/glassfish/v3/58/glassfishv3/bin &gt;<span>./asadmin ping-connection-pool
jdbc/states</span><br>
          <br>
Command ping-connection-pool executed successfully.<br>
~/tools/glassfish/v3/58/glassfishv3/bin &gt;<span>./asadmin create-jdbc-resource
--connectionpoolid jdbc/states jdbc/jndi_states</span><br>
          <br>
Command create-jdbc-resource executed successfully.</td>
        </tr>
      </tbody>
    </table>
    <br>
  </li>
  <li>Download <a href="http://bits.netbeans.org/netbeans/6.8/m1/">NetBeans
6.8 M1</a> and install "All" version. Expand "Servers" node and
add the recently installed GlassFish server.</li>
  <li>Create a new Web project and name it "HelloEclipseLink".
Make sure to choose "GlassFish v3" as the server and "Java EE 6 Web" as
the Java EE version as shown below:<br>
    <br>
    <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-javaee6web.png" /><br>
    <br>
Take defaults elsewhere.</li>
  <li>Create the Persistence Unit</li>
  <ol>
    <li>Right-click on the newly created project and select
"New", "Entity Classes from Database ...". Choose the earlier created
data source "jdbc/jndi_states" as shown below:<br>
      <br>
      <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-datasource.png" /></li>
    <li>Select "STATES" table in "Available Tables:" and click on
"Add &gt;" and then "Next &gt;".</li>
    <li>Click on "Create Persistence Unit ...", take all the
defaults and click on "Create". "EclipseLink" is the Reference
Implementation for JPA 2.0 is the default choosen Persistence Provider
as shown below:<br>
      <br>
      <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-pu.png" /></li>
    <li>Enter the package name as "server" and click on "Finish".</li>
  </ol>
  <li>Create a Servlet to retrieve and display all the
information from the database</li>
  <ol>
    <li>Right click on the project, "New", "Servlet ...".</li>
    <li>Give the Servlet name "ShowStates" and package "server".</li>
    <li>Even
though you can take all the defaults and click on "Finish" but instead
click on "Next &gt;" and the following screen is shown:<br>
      <br>
      <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-servlet-deployment.png" /><br>
      <br>
Notice
"Add information to deployment descriptor (web.xml)" checkbox. Servlet
3.0 makes "web.xml" optional in most of the common cases by providing
corresponding annotations and NetBeans 6.8 leverages that
functionality. As a result, no "web.xml" will be bundled in our WAR
file. Click on "Finish" now.<br>
      <br>
The generated servlet code looks like:<br>
      <br>
      <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-servlet-annotations.png" /><br>
      <br>
Notice @WebServlet annotation, this makes "web.xml" optional. <a href="http://blogs.sun.com/arungupta/entry/totd_81_getting_started_with">TOTD
#82</a> provide another example on how to use Servlet 3.0 with
EJB 3.1.</li>
    <li>Inject the Persistence Unit as:<br>
      <br>
      <table
 cellpadding="2" cellspacing="2">
        <tbody>
          <tr>
            <td>&nbsp;&nbsp;&nbsp; @PersistenceUnit<br>
&nbsp;&nbsp;&nbsp; EntityManagerFactory emf;</td>
          </tr>
        </tbody>
      </table>
      <br>
right above "processRequest" method.</li>
    <li>Change the "try" block of "processRequest" method to:<br>
      <br>
      <table
 cellpadding="2" cellspacing="2">
        <tbody>
          <tr>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
List&lt;States&gt; list =
emf.createEntityManager().createNamedQuery("States.findAll").getResultList();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
out.println("&lt;table border=\"1\"&gt;");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (States state : list) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
out.println("&lt;tr&gt;&lt;td&gt;" + state.getAbbrev() +<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
"&lt;/td&gt;&lt;td&gt;" + state.getName() +<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
"&lt;/td&gt;&lt;/tr&gt;");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
out.println("&lt;/table&gt;");</td>
          </tr>
        </tbody>
      </table>
      <br>
This uses a predefined query to retrieve all rows from the table and
then display them in a simple formatted HTML table.</li>
  </ol>
  <li>Run the project</li>
  <ol>
  </ol>
  <ol>
    <li>Right click on the project, select "Properties" and
change the "Relative URL" to "/ShowStates". This is the exact URL that
you specified earlier.<br>
      <br>
      <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-run.png" /></li>
    <li>Right-click on the project and select "Run" to see the
following output:<br>
      <br>
      <img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-output.png" /><br>
      <br>
    </li>
  </ol>
</ol>
So we created a simple web application that uses Servlet 3.0, JPA 2.0,
EclipseLink and deployed on GlassFish v3 using NetBeans 6.8 M1.
NetBeans provides reasonable defaults making you a lazy programmer.
Believe this is more evident when you start playing with Java EE
support in other IDEs ;-)<br>
<br>
Finally, lets look at the structure of the generated WAR file:<br>
<br>
<img alt="" src="http://blogs.sun.com/arungupta/resource/images/nb68m1-jpa-dir-structure.png" /><br>
<br>
It's very clean - no "web.xml", only the relevant classes and
"persistence.xml".<br>
<br>
Also refer to other <a href="http://blogs.sun.com/arungupta/tags/javaee6">Java EE 6
blog entries</a>. A future blog entry will show how to use JSF
2.0 instead of Servlet for displaying the results.<br>
<br>
Please leave suggestions on other TOTD that
you'd like to see.
A complete archive of all the tips is available <a href="http://blogs.sun.com/arungupta/tags/totd">here</a>.
<br>
<br>
<small>Technorati: <a href="http://technorati.com/tags/totd">totd</a>
<a href="http://technorati.com/tags/glassfish">glassfish</a>
<a href="http://technorati.com/tags/v3">v3</a> <a href="http://technorati.com/tags/mysql">mysql</a> <a href="http://technorati.com/tags/javaee6">javaee6</a> <a href="http://technorati.com/tags/servlet3">servlet3</a>
<a href="http://technorati.com/tags/jpa2">jpa2</a> <a href="http://technorati.com/tags/netbeans">netbeans</a></small><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20629&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20629&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2009/08/13/totd-93-getting-started-with-java-ee-6-using-netbeans-6-8-m1-glassfish-v3-a-simple-servlet-3-0-jpa-2-0-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

