The complete code for the post on using Oracle's XMLType with JPA
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Storing XML natively in Oracle with JPA

This is the complete code as described in this post:

Running the example app

You will need a local instance of Oracle database running before you start the example app. The quickest way to get this up and running is by running the following Docker container:

$ docker run -d -p 49161:1521 wnameless/oracle-xe-11g

once the container has started, start the example Spring Boot based app with:

$ mvn spring-boot:run

Placing an order

To test the placing of an order, use curl with the following request:

$ curl -X POST --header "Content-Type: application/xml" --header "Accept: */*" -d "
    <customer>Bob Smith</customer>
" "http://localhost:8080/orders"

Running the functional test

To exercise the test, which uses an in memory H2 instead of the Oracle instance, run

$ mvn test

Oracle JDBC dependencies

Since the Oracle JDBC/XDB jars are not publicly available, you will have to source the jars for the dependencies below from your own Oracle installation. You can then install them into your local Maven repo or install into your companies Maven repo of choice (Sonatype Nexus, etc.)

You will need the equivalent dependencies from your Oracle installation for the following: