[ 
https://issues.apache.org/jira/browse/OPENJPA-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056927#comment-13056927
 ] 

sebastien morissette commented on OPENJPA-2022:
-----------------------------------------------

I use an ant task and i added the schema name in my persistence.xml 

here is my build.xml : 

<?xml version="1.0" encoding="UTF-8"?>
<project name="rmtools" default="reverse-map-schema">
        <path id="classpath"
                description="The classpath to use for compiling and running">
                <pathelement path="../"/>
                <fileset  dir="../">
                    <include name="lib/openjpa-all-2.1.1-SNAPSHOT.jar"/>
                    <include name="lib/ojdbc6.jar"/>
                </fileset>
            </path>
    <target name="reverse-map-schema" description="Generate java files from the 
database schema">
        
        <java fork="true" failonerror="yes" 
classname="org.apache.openjpa.conf.OpenJPAVersion" classpathref="classpath"/>
        <!-- now run the tool to generate java files from the db schema -->
        <taskdef name="reversemappingtool" classpathref="classpath" 
classname="org.apache.openjpa.jdbc.ant.ReverseMappingToolTask"/>
        <reversemappingtool package="com.rmtools.util.dao" directory="../src" 
innerIdentityClasses="true">
              <codeformat tabSpaces="4" spaceBeforeParen="false" 
braceOnSameLine="true"/>
        </reversemappingtool>
        
     
    </target>
</project>


here is my persistence.xml  :

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    version="1.0">
  <persistence-unit name="openjpa">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
 <class>com.rmtools.dao.beans.AppUsers</class>
 
    <properties>
      <property name="openjpa.ConnectionURL" 
value="jdbc:oracle:thin:@192.168.1.102:1521:xe"/>
      <property name="openjpa.ConnectionDriverName" 
value="oracle.jdbc.OracleDriver"/>
      <property name="openjpa.ConnectionUserName" value="xxxx"/>
      <property name="openjpa.ConnectionPassword" value="xxxx"/>
      <property name="openjpa.jdbc.Schema" value="rmtools"/>
      <property name="openjpa.Log" value="DefaultLevel=TRACE, 
Tool=TRACE,org.apache.openjpa.jdbc.Schema=TRACE"/>
    </properties>
  </persistence-unit>
</persistence>




> Reversemappingtooltask with oracle is failing like in OPENJPA-1940 previous 
> bug
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2022
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2022
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: tooling
>    Affects Versions: 2.1.0, 2.1.1, 2.2.0
>         Environment: Woking on a windows pc with a oracle 10g express 
> database, eclipse helios, using oracle 11.2.0.2 driver. 
>            Reporter: sebastien morissette
>            Assignee: Michael Dick
>             Fix For: 2.1.1, 2.2.0
>
>
> When running either of the versions of the reversemappingtool as reported in 
> the 1940 bug as fixed, i get the same error as in 2.1.0 :
> [reversemappingtool] 2363  openjpa  INFO   [main] openjpa.Tool - 
> ReverseMappingTool : generating classes.
> [reversemappingtool] 2365  openjpa  INFO   [main] openjpa.MetaData - Table 
> "RMTOOLS."AppUsers"" could not be reverse mapped.  This means that the table 
> does not have a primary key (primary keys are required to establish unique 
> identifiers for all persistent objects) and does not match a known pattern 
> for a table used for cross-reference or value collections.
> [reversemappingtool] 2366  openjpa  INFO   [main] openjpa.MetaData - Table 
> "RMTOOLS."CredentialTypes"" could not be reverse mapped.  This means that the 
> table does not have a primary key (primary keys are required to establish 
> unique identifiers for all persistent objects) and does not match a known 
> pattern for a table used for cross-reference or value collections.
> [reversemappingtool] 2366  openjpa  INFO   [main] openjpa.MetaData - Table 
> "RMTOOLS."Credentials"" could not be reverse mapped.  This means that the 
> table does not have a primary key (primary keys are required to establish 
> unique identifiers for all persistent objects) and does not match a known 
> pattern for a table used for cross-reference or value collections.
> this happens for all my tables. Is it possible this bug was reintroduced?
> thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to