Link to home
Start Free TrialLog in
Avatar of thomasbau65
thomasbau65

asked on

JPA Create and Read from existing DB

Hi
I have a DB (MSSQL-Server) which I connect using EclipseLink

 
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="PersistenceTestPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>persistencetest.Act</class>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:jtds:sqlserver://localhost:1433/DBNAME"/>
      <property name="javax.persistence.jdbc.password" value="mypassword"/>
      <property name="javax.persistence.jdbc.driver" value="net.sourceforge.jtds.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.user" value="dbuser"/>
    </properties>
  </persistence-unit>
</persistence>

Open in new window


The tables (existing) in the database have names beginning with AAP, thus a table CUSTOMER would be listed as AAP.CUSTOMER when viewed with "SQL Server Management Studio Express"

My problem is, that when I create a table, JPA is creating it as dbo.CUSTOMER

How can I force JPA to write to the AAP.CUSTOMER table

Thanks for helping out


ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial