{"id":781,"date":"2012-02-01T16:04:00","date_gmt":"2012-02-01T16:04:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/sneak-peak-at-java-ee-7-multitenant-examples-with-eclipselink.html"},"modified":"2012-10-21T22:37:39","modified_gmt":"2012-10-21T22:37:39","slug":"sneak-peak-at-java-ee-7-multitenant","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html","title":{"rendered":"Sneak peak at Java EE 7 &#8211; Multitenant Examples with EclipseLink"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference implementations. They picked up a presentation by Oracle&#8217;s Shaun Smith (<a href=\"http:\/\/onpersistence.blogspot.com\/\">blog<\/a>\/<a href=\"http:\/\/twitter.com\/shaunmsmith\/\">twitter<\/a>) about the status and future of EclipseLink as an open source project. He covers all the new features which are going to be in EclipseLink 2.4 which will be availabke along with the June Eclipse Juno Release. In detail these are REST, NoSQL and Multitenancy. (details refer to the <a href=\"http:\/\/marsjug.org\/download\/Shaun%20Smith-The%20Evolution%20of%20Java%20Persistence.pdf\">complete slide-deck (PDF)<\/a> from the marsjug event.)<\/p>\n<p>I like to see that EclipseLink still is the center of innovation in Java persistence and they are trying hard to adopt latest buzz timely. Working for a more conservative industry in general the main new feature I am looking for is multitenancy. What you can guess from the slides is, that something in this field should already be working with latest EclipseLink 2.3.0.<\/p>\n<p><strong>What is Multitenancy going to look like?<\/strong><br \/>\nLet&#8217;s start looking at what Oracle&#8217;s Linda DeMichiel announced at last years JavaOne (compare <a href=\"http:\/\/blog.eisele.net\/2011\/10\/java-ee-past-present-cloud-7.html\">blog-post<\/a>) and also let&#8217;s look at what the<a href=\"http:\/\/download.oracle.com\/otn-pub\/jcp\/persistence-2_1-edr-spec\/persistence-2_1-edr-spec.pdf\"> early draft (PDF)<\/a> of the JPA 2.1 specification has to offer. The easier part is the early draft. Not a single line mentions &#8220;Multitenan[t|cy]&#8221; in any context. So, this is obviously still a big to do for further iterations. A bit more could be found in the <a href=\"https:\/\/oracleus.wingateweb.com\/published\/oracleus2011\/sessions\/37761\/02_Tuesday_JavaOne%20Session_FINAL.pdf%20(PDF)\">JavaOne Strategy Keynote<\/a> (Slides 41,42) and the <a href=\"https:\/\/oracleus.wingateweb.com\/published\/oracleus2011\/sessions\/37760\/37760b_Cho.pdf\">JavaOne Technical Keynote (PDF)<\/a> (Slide 25). The general Java EE 7 approach will be to have support for separate isolated instances of the same app for different tenants. The mapping should be done by the container and be available to apps in some way. This is all very vague until today and the only concrete code examples available from the slides refer to some obvious JPA related examples using two annotations @Multitenant and @TenantDiscriminatorColumn. Hmm. Doesn&#8217;t this look familiar to you? <\/p>\n<p><strong>What is possible today?<\/strong><br \/>\nIt does! EclipseLink (as of 2.3.0 &#8211; Indigo) supports shared multitenant tables using tenant discriminator column(s), allowing an application to be re-used for multiple tenants and have all their data co-located. All tenants share the same schema without being aware of one another and can use non-multitenant entity types as per usual. But be aware of the fact, that this is only one possible approach to multitenancy for data. This is commonly referred to as &#8220;dedicated database&#8221; because all tenant&#8217;s data go into one single db! The basic principles for the following are:<br \/>\n&#8211; application instances handle multiple tenants<br \/>\n&#8211; caching has to be isolated for every tenant by JPA<br \/>\nYou can look at all the details on a dedicated EclipseLink <a href=\"http:\/\/wiki.eclipse.org\/EclipseLink\/Examples\/JPA\/Multitenant\">wiki page<\/a>. Want to give it a test drive? let&#8217;s start. Prerequisites as usual (NetBeans, GlassFish, MySQL, compare older posts if you need more help.). Make sure to have the right EclipseLink dependencies (at least 2.3.0)! Create a new entity via the wizard, setup your datasource and persistence.xml and call it e.g. Customer.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush: java;\">@Entity\r\npublic class Customer implements Serializable {\r\n\/\/...\r\n}\r\n<\/pre>\n<p>If you start your app you see EclipseLink creating something like this in your database. <\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-UHTOhghF2W4\/TycNjbWnhNI\/AAAAAAAAAHg\/8UG3FZTb__8\/s1600\/simply_customer.png\"><img decoding=\"async\" border=\"0\" height=\"101\" src=\"http:\/\/4.bp.blogspot.com\/-UHTOhghF2W4\/TycNjbWnhNI\/AAAAAAAAAHg\/8UG3FZTb__8\/s320\/simply_customer.png\" width=\"320\" \/><\/a><\/div>\n<p>Let&#8217;s make this a multitenant entity. Add the following annotations:<\/p>\n<pre class=\"brush: java;\">@Entity\r\n@Multitenant\r\n@TenantDiscriminatorColumn(name = \"companyId\", contextProperty = \"company-tenant.code\")\r\npublic class Customer implements Serializable {\r\n\/\/...\r\n}\r\n<\/pre>\n<p>There are multiple usage options available for how an EclipseLink JPA persistence unit can be used in an application with @Multitenant entity types. Since different tenants will have access to only its rows the persistence layer must be configured so that entities from different tenants do not end up in the same cache. If you compare the detailed approaches (Dedicated PC, PC per tenant, PU per tenant) in more detail, you see, that as of today you end up having two possible options with container managed injection of either the PC or the PU. Let&#8217;s try the simplest thing first. <\/p>\n<p><strong>Dedicated Persistence Unit<\/strong><br \/>\nIn this usage there is a persistence unit defined per tenant and the application\/container must request the correct PersistenceContext or PersistenceUnit for its tenant. There is one single persistence unit and nothing is shared. Go with the above example and add the following property to your persistence.xml:<\/p>\n<pre class=\"brush: xml;\">&lt;property name=\"company-tenant.code\" value=\"TENANT1\" \/&gt;\r\n<\/pre>\n<p>Give it a try and compare the tables.<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-i-T0Mw9SF1c\/TycOFeLDxoI\/AAAAAAAAAHo\/lF2oUlz8cbo\/s1600\/dedicated_customer.png\"><img decoding=\"async\" border=\"0\" height=\"95\" src=\"http:\/\/4.bp.blogspot.com\/-i-T0Mw9SF1c\/TycOFeLDxoI\/AAAAAAAAAHo\/lF2oUlz8cbo\/s320\/dedicated_customer.png\" width=\"320\" \/><\/a><\/div>\n<p>As you can see, you now have your companyId column. If you insert some data it will always be filled with the property value you assigned in the persistence.xml. Use either a  @PersistenceContext or a  @PersistenceUnit to access your entities. Using this approach you have a shared cache as usual for your application.<\/p>\n<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"tr-caption-container\" style=\"margin-left: auto;margin-right: auto;text-align: center\">\n<tbody>\n<tr>\n<td style=\"text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-cDXVDVy4FLY\/TycOQhyYKFI\/AAAAAAAAAHw\/2zNI4NXy6pI\/s1600\/em_w_shared_cache.png\"><img decoding=\"async\" border=\"0\" height=\"145\" src=\"http:\/\/3.bp.blogspot.com\/-cDXVDVy4FLY\/TycOQhyYKFI\/AAAAAAAAAHw\/2zNI4NXy6pI\/s320\/em_w_shared_cache.png\" width=\"320\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center\"><span class=\"Apple-style-span\" style=\"background-color: white;font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif;font-size: 11px;line-height: 14px\">@PersistenceContext with Shared Cache (Source: S.Smith)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Persistence Context per Tenant<\/strong><br \/>\nIf you don&#8217;t want to have a single tenant per application you could decide to have a single persistence unit definition in the persistence.xml and a shared persistence unit (EntityManagerFactory and cache) in you application. In this case the tenant context needs to be specified per EntityManager at runtime. In this case you have a shared cache available for regular entity types but the @Multitenant types must be protected in the cache. You do this by specifying some properties:<\/p>\n<pre class=\"brush: java;\">@PersistenceUnit\r\nEntityManagerFactory emf;\r\nMap props = new HashMap();\r\nprops.put(\"company-tenant.code\", \"TENANT2\");\r\nprops.put(PersistenceUnitProperties.MULTITENANT_SHARED_EMF, true);\r\nEntityManager em = emf.createEntityManager(props);\r\n<\/pre>\n<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"tr-caption-container\" style=\"margin-left: auto;margin-right: auto;text-align: center\">\n<tbody>\n<tr>\n<td style=\"text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-pdpzXm5efhQ\/TycOo_G1WoI\/AAAAAAAAAH4\/v7wArgy-Eos\/s1600\/em_w_o_shared_cache.png\"><img decoding=\"async\" border=\"0\" height=\"131\" src=\"http:\/\/3.bp.blogspot.com\/-pdpzXm5efhQ\/TycOo_G1WoI\/AAAAAAAAAH4\/v7wArgy-Eos\/s320\/em_w_o_shared_cache.png\" width=\"320\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center\"><span class=\"Apple-style-span\" style=\"background-color: white;font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif;font-size: 11px;line-height: 14px\">Shared @PersistenceUnit per tentant (Source: S.Smith)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Discriminator Approaches<\/strong><br \/>\nThe above examples work with a single discriminator tenant column. You can add the discriminator column to the PK by specifying a primaryKey attribute like the following:<\/p>\n<pre class=\"brush: java;\">@TenantDiscriminatorColumn(name = \"companyId\", contextProperty = \"company-tenant.code\", primaryKey = true)\r\n<\/pre>\n<p>It&#8217;s also possible to have multiple tenant discriminator columns using multiple tables if you do something like this: <\/p>\n<pre class=\"brush: java;\">@Entity\r\n@SecondaryTable(name = \"TENANTS\")\r\n@Multitenant\r\n@TenantDiscriminatorColumns({\r\n    @TenantDiscriminatorColumn(name = \"TENANT_ID\", contextProperty = \"company-tenant.id\", length = 20, primaryKey = true),\r\n    @TenantDiscriminatorColumn(name = \"TENANT_CODE\", contextProperty = \"company-tenant.code\", discriminatorType = DiscriminatorType.STRING, table = \"TENANTS\")\r\n})\r\n<\/pre>\n<p>This leads to a secondary tenants table.<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-JuiO9v245wA\/TycPGGcB4wI\/AAAAAAAAAIA\/DqNStUO52Rk\/s1600\/multiple_table.png\"><img decoding=\"async\" border=\"0\" height=\"62\" src=\"http:\/\/1.bp.blogspot.com\/-JuiO9v245wA\/TycPGGcB4wI\/AAAAAAAAAIA\/DqNStUO52Rk\/s320\/multiple_table.png\" width=\"320\" \/><\/a><\/div>\n<p><strong>Additional Goodies<\/strong><br \/>\nAs always you can do the complete configuration within your persistence.xml only, too. For a reference please look at the already mentioned wiki page. One last thing is of interest. You could also map the tenant discriminator column with your entity. You simple have to make sure it isn&#8217;t updated or inserted.<\/p>\n<pre class=\"brush: java;\">@Basic\r\n   @Column(name = \"TENANT_ID\", insertable = false, updatable = false)\r\n   private int tenantId;\r\n \r\n   public int getTenantId() {\r\n       return tenantId;\r\n   }\r\n<\/pre>\n<p>Looking at the debug output you can see what is happening behind the scenes:<\/p>\n<p><span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">INFO: Getting EntityManager<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">INFO: Inserting Test Customer <\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">FEIN: INSERT INTO CUSTOMER (ID, TENANT_ID) VALUES (?, ?)<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">bind =&gt; [1, 2]<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">FEIN: INSERT INTO TENANTS (ID, TENANT_CODE) VALUES (?, ?)<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">bind =&gt; [1, TENANT2]<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">FEIN: SELECT t0.ID, t1.TENANT_CODE, t0.TENANT_ID, t1.ID FROM CUSTOMER t0, TENANTS t1 WHERE (((t1.ID = t0.ID) AND (t1.TENANT_CODE = ?)) AND (t0.TENANT_ID = ?))<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-family: 'Courier New', Courier, monospace\">bind =&gt; [TENANT2, 2]<\/span><\/p>\n<p>Curious for more Java EE 7 and JPA 2.1 goodies? Keep updated with the <a href=\"http:\/\/wiki.eclipse.org\/EclipseLink\/Development\/JPA_2.1\">development status wiki page<\/a> for the EclipseLink JPA 2.1 project.<\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/blog.eisele.net\/2012\/01\/sneak-peak-at-java-ee-7-multitenant.html\">Sneak peak at Java EE 7 &#8211; Multitenant Examples with EclipseLink<\/a>&nbsp;from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a><span class=\"Apple-style-span\" style=\"font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif\"><span class=\"Apple-style-span\" style=\"font-size: 14px;line-height: 18px\"><strong>&nbsp;<\/strong><\/span><\/span>Markus Eisele at the&nbsp;<a href=\"http:\/\/blog.eisele.net\/\">Enterprise Software Development with Java <\/a>blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference implementations. They picked up a presentation by Oracle&#8217;s Shaun Smith (blog\/twitter) about the status and future of EclipseLink as an open source project. He covers all the new features which are going to &hellip;<\/p>\n","protected":false},"author":92,"featured_media":109,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[333,302],"class_list":["post-781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-eclipselink","tag-java-ee7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/eisele.markus\" \/>\n<meta property=\"article:published_time\" content=\"2012-02-01T16:04:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T22:37:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/eclipselink-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Markus Eisele\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/myfear\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Markus Eisele\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html\"},\"author\":{\"name\":\"Markus Eisele\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/83c0139425aee143ae0d269868475066\"},\"headline\":\"Sneak peak at Java EE 7 &#8211; Multitenant Examples with EclipseLink\",\"datePublished\":\"2012-02-01T16:04:00+00:00\",\"dateModified\":\"2012-10-21T22:37:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html\"},\"wordCount\":1085,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/eclipselink-logo.jpg\",\"keywords\":[\"EclipseLink\",\"Java EE7\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html\",\"name\":\"Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/eclipselink-logo.jpg\",\"datePublished\":\"2012-02-01T16:04:00+00:00\",\"dateModified\":\"2012-10-21T22:37:39+00:00\",\"description\":\"The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/eclipselink-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/eclipselink-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/02\\\/sneak-peak-at-java-ee-7-multitenant.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Sneak peak at Java EE 7 &#8211; Multitenant Examples with EclipseLink\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/83c0139425aee143ae0d269868475066\",\"name\":\"Markus Eisele\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/231f7cefb75b74a4fb2ef22cd99fe55d2a9323ceca56e8bc9b19533bae3dac6a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/231f7cefb75b74a4fb2ef22cd99fe55d2a9323ceca56e8bc9b19533bae3dac6a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/231f7cefb75b74a4fb2ef22cd99fe55d2a9323ceca56e8bc9b19533bae3dac6a?s=96&d=mm&r=g\",\"caption\":\"Markus Eisele\"},\"description\":\"Markus is a Developer Advocate at Red Hat and focuses on JBoss Middleware. He is working with Java EE servers from different vendors since more than 14 years and talks about his favorite topics around Java EE on conferences all over the world. He has been a principle consultant and worked with different customers on all kinds of Java EE related applications and solutions. Beside that he has always been a prolific blogger, writer and tech editor for different Java EE related books. He is an active member of the German DOAG e.V. and it's representative on the iJUG e.V. As a Java Champion and former ACE Director he is well known in the community. Follow him on Twitter @myfear.\",\"sameAs\":[\"http:\\\/\\\/blog.eisele.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/eisele.markus\",\"http:\\\/\\\/de.linkedin.com\\\/in\\\/markuseisele\\\/en\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/myfear\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/markus-eisele\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink - Java Code Geeks","description":"The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html","og_locale":"en_US","og_type":"article","og_title":"Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink - Java Code Geeks","og_description":"The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference","og_url":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/eisele.markus","article_published_time":"2012-02-01T16:04:00+00:00","article_modified_time":"2012-10-21T22:37:39+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/eclipselink-logo.jpg","type":"image\/jpeg"}],"author":"Markus Eisele","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/myfear","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Markus Eisele","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html"},"author":{"name":"Markus Eisele","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/83c0139425aee143ae0d269868475066"},"headline":"Sneak peak at Java EE 7 &#8211; Multitenant Examples with EclipseLink","datePublished":"2012-02-01T16:04:00+00:00","dateModified":"2012-10-21T22:37:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html"},"wordCount":1085,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/eclipselink-logo.jpg","keywords":["EclipseLink","Java EE7"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html","url":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html","name":"Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/eclipselink-logo.jpg","datePublished":"2012-02-01T16:04:00+00:00","dateModified":"2012-10-21T22:37:39+00:00","description":"The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/eclipselink-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/eclipselink-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/02\/sneak-peak-at-java-ee-7-multitenant.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Sneak peak at Java EE 7 &#8211; Multitenant Examples with EclipseLink"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/83c0139425aee143ae0d269868475066","name":"Markus Eisele","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/231f7cefb75b74a4fb2ef22cd99fe55d2a9323ceca56e8bc9b19533bae3dac6a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/231f7cefb75b74a4fb2ef22cd99fe55d2a9323ceca56e8bc9b19533bae3dac6a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/231f7cefb75b74a4fb2ef22cd99fe55d2a9323ceca56e8bc9b19533bae3dac6a?s=96&d=mm&r=g","caption":"Markus Eisele"},"description":"Markus is a Developer Advocate at Red Hat and focuses on JBoss Middleware. He is working with Java EE servers from different vendors since more than 14 years and talks about his favorite topics around Java EE on conferences all over the world. He has been a principle consultant and worked with different customers on all kinds of Java EE related applications and solutions. Beside that he has always been a prolific blogger, writer and tech editor for different Java EE related books. He is an active member of the German DOAG e.V. and it's representative on the iJUG e.V. As a Java Champion and former ACE Director he is well known in the community. Follow him on Twitter @myfear.","sameAs":["http:\/\/blog.eisele.net\/","https:\/\/www.facebook.com\/eisele.markus","http:\/\/de.linkedin.com\/in\/markuseisele\/en","https:\/\/x.com\/http:\/\/twitter.com\/myfear"],"url":"https:\/\/www.javacodegeeks.com\/author\/markus-eisele"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=781"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/781\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/109"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}