Hi again.

I have a variation on my persistence.xml and I'm not sure about the best
approach to achieve my goal.

When I deploy the package to the JBoss Server, my persistence.xml must look
like this:

<persistence-unit name="NAME" transaction-type="JTA">

... (dozens of lines)

<jta-data-source>JNDI_NAME_FOR_MY_DATASOURCE</jta-data-source>

... (dozens of lines)

</persistence>

But for the unit tests, I run JPA standalone (out of JBoss) and so the
persistence-unit.xml must look like this:

<persistence-unit name="NAME" transaction-type="RESOURCE_LOCAL">

... (dozens of lines)

<property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver" />
<property name="eclipselink.jdbc.url" value="..." />
<property name="eclipselink.jdbc.user" value="..." />
<property name="eclipselink.jdbc.password" value="..." />

... (dozens of lines)

</persistence>

As far as I know, properties values can only be Strings.

So even if I only need to make those few changes, the best (and maybe only)
way to automate this using profiles is to have a copy of that quite huge
file with the variations, although, of course, it comes with the downside of
needing to maintain both files consistent?

Regards,
Rafael Vanderlei.

Reply via email to