Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

JPA Tools Smoke Test

Project creation

  • Create a "New JPA Project"
  • Select the "Generic" Platform and "Java 1.7" facet configuration
  • Set up a DB and library that contains a JPA implementation (this can be Oracle, DB2, MySQL, Sybase, etc...)

Java Source test

  • Create a JPA Entity in the project and add at least 3 attributes
  • Make one of the attributes the Id for the Entity using the JPA Details
  • Verify that the appropriate annotations have been inserted into the Java source

Generate annotated source

  • Right-click on the project and select JPA Tools->Generate Entities from Tables...
  • Examine the generated Entities
  • Edit an @Column name to be wrong and ensure that validation picks up the error

orm.xml test

  • Create a new orm.xml file in the src or meta-inf directory of your Generic project
  • Paste in the following content
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="1.0" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
	<entity name="model.EmployeeEntity" class="model.Employee">
	    <table name="Employee"/>
		<table-generator name="EMPLOYEE_GENERATOR_TABLE" table="EMP_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="EMP_SEQ"/>
			<id name="empId">
				<column name="EMP_ID"/>
				<generated-value strategy="TABLE" generator="EMPLOYEE_GENERATOR_TABLE"/>
			<basic name="fName">
				<column name="F_NAME"/>
			<basic name="lName">
				<column name="L_NAME"/>
			<one-to-many name="phones" target-entity="model.Phone" mapped-by="employee">
  • Verify that the JPA structure pane displays the correct values
  • Edit the fName mapping and confirm that the file and or UI is updated

Project Explorer

  • Open the Project Explorer view and verify that the content is correct


  • Perform all of the above steps to test the EclipseLink extension

Back to the top