Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/JPA/Multitenant/Tutorial"

(Example Application)
(Setup)
Line 32: Line 32:
 
=== Setup ===
 
=== Setup ===
  
 +
After downloading the tutorial source (zip file) you must perform the following steps:
 +
 +
# Unzip the tutorial
 +
# Open the tutorial projects in Eclipse
 +
# Configure the classpath and dependent libraries
  
 
=== @Multitenant ===
 
=== @Multitenant ===

Revision as of 18:03, 2 October 2011

EclipseLInk Multi-Tenant Tutorial

This tutorial will walk a developer through the steps necessary to take a simple domain model mapped with JPA and make it multitenant enabled with both EclipseLInk managed additional criteria as well as Oracle Virtual Private Database (VPD) usage.

Overview

  1. Setup and configure environment
    1. Run basic tests
  2. Configure for multi-tenancy using EclipseLink to apply additional tenant criteria
    1. Run multi-tenant tests
  3. Configure for multi-tenancy using EclipseLink and Oracle VPD
    1. Run multi-tenant VPD tests

Software Requirements

  • EclipseLink 2.3.1 - build 20110910 or later
  • Example application (SVN)
  • Oracle Database
    • Must support Oracle VPD
    • Database user must have proper priviledges

Application Domain

In the tutorial the domain being used is that of a sports league. The web application allows interested users to view information about various leagues with their Division(s), Team(s), and Player(s).

Tutorial Steps

NOTE: Please follow the steps carefully.

This tutorial provides a sample application that is ready to run and includes JUnit tests which create the schema, populate the sample data, and run example persistence operations to verify proper functionality. At each stage of the tutorial a different set of tests will be run.

Setup

After downloading the tutorial source (zip file) you must perform the following steps:

  1. Unzip the tutorial
  2. Open the tutorial projects in Eclipse
  3. Configure the classpath and dependent libraries

@Multitenant

@Multitenant(VPD)

In this stage of the tutorial you are going to switch from using EclipseLink's additional criteria being added to all queries to

Setup Database

In order to use Oracle VPD the user 'mttorial will need to have permission. This requires the user to have specific permissions or to have the DBA role. For simplicity in this tutorial you will simply grant the user the DBA role.

Back to the top