You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Marc Prud'hommeaux (JIRA)" <ji...@apache.org> on 2007/02/13 08:59:05 UTC

[jira] Created: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Entity name is ignored when specified in the orm.xml file
---------------------------------------------------------

                 Key: OPENJPA-142
                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
            Reporter: Marc Prud'hommeaux


The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:

   <entity name="Foo" class="mypackage.Bar">

the entity will be aliased to "Bar", rather than to "Foo".

Original report by Dain Sundstrom on the open-jpa-dev mailing list:

I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:

    <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
        <description>BasicCmp2Bean</description>
        <attributes>
            <id name="id"/>
            <basic name="firstName"/>
            <basic name="lastName"/>
        </attributes>
    </entity>


The following query does not work:

        SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1

But this one does:

        SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1

When the query fails, I get this message (reformatted a bit with ** added to important entries):

ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
  [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
AllowedOperationsCmpBean=
  [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
ContextLookupCmpBean=
  [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
Employee=
  [class org.apache.openejb.test.entity.cmp2.Employee],
ManyOwningSideBean_ManyOwningSideBean=
  [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
**BasicCmp2Bean_BasicCmp2Bean=
  [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
EncCmpBean=
  [class org.apache.openejb.test.entity.cmp.EncCmpBean],
BBean_OneToOneB=
  [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
OneOwningSideBean_OneOwningSideBean=
  [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
ABean_OneToOneA=
  [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
**BasicCmp2Bean=null,
RmiIiopCmpBean=
  [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
ABean_OneToManyA=
  [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
OneInverseSideBean_OneInverseSideBean=
  [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
BBean_OneToManyB=
  [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
  [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
EncCmp2Bean_EncCmp2Bean=
  [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
BasicCmpBean=
  [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-142:
------------------------------------

        Fix Version/s: 0.9.7
    Affects Version/s: 0.9.0
                       0.9.6

> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 0.9.0, 0.9.6
>            Reporter: Marc Prud'hommeaux
>             Fix For: 0.9.7
>
>         Attachments: Tests-JPA-1.zip
>
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-142.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 0.9.7)

> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Marc Prud'hommeaux
>         Attachments: Tests-JPA-1.zip
>
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Ephemeris Lappis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ephemeris Lappis updated OPENJPA-142:
-------------------------------------

    Attachment: Tests-JPA-1.zip

A simple project with the same error :

30  my-persistence-unit-for-open-jpa  INFO   [main] openjpa.Runtime - Starting OpenJPA 0.9.7-incubating-SNAPSHOT
140  my-persistence-unit-for-open-jpa  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.DerbyDictionary".
270  my-persistence-unit-for-open-jpa  INFO   [main] openjpa.MetaData - Found 3 classes with metadata in 10 milliseconds.
Exception in thread "main" <4|true|0.9.7-incubating-SNAPSHOT> org.apache.openjpa.persistence.ArgumentException: Could not locate metadata for the class using alias "Person". Registered alias mappings: "{Person=null}"
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:345)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:164)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:142)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:211)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:181)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:174)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500(JPQLExpressionBuilder.java:61)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1668)
	at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52)
	at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:145)
	at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:644)
	at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:625)
	at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:591)
	at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:653)
	at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1475)
	at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:120)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:214)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:264)
	at my.jpa.one.Test.test(Test.java:34)
	at my.jpa.one.MainForOpenJPA.main(MainForOpenJPA.java:7)

> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Marc Prud'hommeaux
>         Attachments: Tests-JPA-1.zip
>
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Ephemeris Lappis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475310 ] 

Ephemeris Lappis commented on OPENJPA-142:
------------------------------------------

I have a similar problem with a really veru simple test that works as expected with TopLink (RI) and Hibernate implementations.
I've tried to add the "name" attribute to the entities annotations, or disable the orm.xml use, but this work-around doesn't seem to work in my case.
I've tested it with the release 0.9.6 and snapshot 0.9.7, and i have the same result...
Does anyone have more ideas ?
NB : I attach my project, just in case...


> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Marc Prud'hommeaux
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Marc Prud'hommeaux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472557 ] 

Marc Prud'hommeaux commented on OPENJPA-142:
--------------------------------------------

This can be worked around by adding the annotation to the class (e.g., @Entity(name="Foo") ).

> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Marc Prud'hommeaux
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-142:
------------------------------------

    Fix Version/s: 0.9.7

> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Marc Prud'hommeaux
>             Fix For: 0.9.7
>
>         Attachments: Tests-JPA-1.zip
>
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file

Posted by "Dain Sundstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472844 ] 

Dain Sundstrom commented on OPENJPA-142:
----------------------------------------

I think I found a related bug to this.  When you have a mapped-superclass and an entity with the same class name (but not the same package).  The query compiler seems to get confused and throws the exception following this message.

You should be able to reproduce this by putting your sub class in a different package but with the same class name, and executing any query.  I'm not sure if this problem goes away by annotating the entity as you described above.

-dain


3276  TRACE  [main] openjpa.jdbc.JDBC - <t 5323819, conn 2614990> [0 ms] close
ERROR - Executing query SELECT o FROM BasicCmpBean o WHERE o.lastName = ?1
11:30:06,372 ERROR [OpenEJB] Executing query SELECT o FROM BasicCmpBean o WHERE o.lastName = ?1
3561  TRACE  [main] openjpa.Query - Executing query: [SELECT o FROM BasicCmpBean o WHERE o.lastName = ?1] with parameters: {1=Blevins}
ERROR - The bean instances business method encountered a system exception:0
<4|false|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: 0
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:798)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:759)
	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:528)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:210)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:251)
	at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.queryBeans(JpaCmpEngine.java:192)
	at org.apache.openejb.core.cmp.CmpContainer.findEJBObject(CmpContainer.java:640)
	at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:245)
	at org.apache.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:56)
	at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:122)
	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:186)
	at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
	at $Proxy35.findByLastName(Unknown Source)
	at org.apache.openejb.test.entity.cmp.CmpHomeIntfcTests.test03_findByLastName(CmpHomeIntfcTests.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.openejb.test.NumberedTestCase.runTestMethod(NumberedTestCase.java:135)
	at org.apache.openejb.test.NumberedTestCase$1.protect(NumberedTestCase.java:120)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at org.apache.openejb.test.NumberedTestCase.run(NumberedTestCase.java:123)
	at org.apache.openejb.test.NumberedTestCase.run(NumberedTestCase.java:102)
	at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
	at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
	at junit.textui.TestRunner.doRun(TestRunner.java:115)
	at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:58)
	at junit.textui.TestRunner.start(TestRunner.java:179)
	at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
	at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:98)
	at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.openjpa.jdbc.kernel.exps.PCPath.appendTo(PCPath.java:633)
	at org.apache.openjpa.jdbc.kernel.exps.EqualExpression.appendTo(EqualExpression.java:68)
	at org.apache.openjpa.jdbc.kernel.exps.CompareEqualExpression.appendTo(CompareEqualExpression.java:95)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere(SelectConstructor.java:235)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(SelectConstructor.java:76)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects(JDBCStoreQuery.java:323)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(JDBCStoreQuery.java:165)
	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:672)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:977)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:789)
	... 30 more
11:30:06,664 ERROR [OpenEJB] The bean instances business method encountered a system exception:0
<4|false|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: 0
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:798)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:759)
	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:528)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:210)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:251)
	at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.queryBeans(JpaCmpEngine.java:192)
	at org.apache.openejb.core.cmp.CmpContainer.findEJBObject(CmpContainer.java:640)
	at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:245)
	at org.apache.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:56)
	at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:122)
	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:186)
	at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
	at $Proxy35.findByLastName(Unknown Source)
	at org.apache.openejb.test.entity.cmp.CmpHomeIntfcTests.test03_findByLastName(CmpHomeIntfcTests.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.openejb.test.NumberedTestCase.runTestMethod(NumberedTestCase.java:135)
	at org.apache.openejb.test.NumberedTestCase$1.protect(NumberedTestCase.java:120)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at org.apache.openejb.test.NumberedTestCase.run(NumberedTestCase.java:123)
	at org.apache.openejb.test.NumberedTestCase.run(NumberedTestCase.java:102)
	at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
	at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
	at junit.textui.TestRunner.doRun(TestRunner.java:115)
	at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:58)
	at junit.textui.TestRunner.start(TestRunner.java:179)
	at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
	at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:98)
	at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.openjpa.jdbc.kernel.exps.PCPath.appendTo(PCPath.java:633)
	at org.apache.openjpa.jdbc.kernel.exps.EqualExpression.appendTo(EqualExpression.java:68)
	at org.apache.openjpa.jdbc.kernel.exps.CompareEqualExpression.appendTo(CompareEqualExpression.java:95)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere(SelectConstructor.java:235)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(SelectConstructor.java:76)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects(JDBCStoreQuery.java:323)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(JDBCStoreQuery.java:165)
	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:672)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:977)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:789)
	... 30 more
org.apache.openejb.InvalidateReferenceException: java.rmi.RemoteException: The bean encountered a non-application exception.; nested exception is: 
	<4|false|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: 0: The bean encountered a non-application exception.; nested exception is: 
	<4|false|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: 0
	at org.apache.openejb.core.transaction.TransactionPolicy.throwExceptionToServer(TransactionPolicy.java:208)
	at org.apache.openejb.core.transaction.TxRequired.handleSystemException(TxRequired.java:83)
	at org.apache.openejb.core.cmp.CmpContainer.findEJBObject(CmpContainer.java:682)
	at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:245)
	at org.apache.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:56)
	at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:122)
	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:186)
	at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
	at $Proxy35.findByLastName(Unknown Source)
	at org.apache.openejb.test.entity.cmp.CmpHomeIntfcTests.test03_findByLastName(CmpHomeIntfcTests.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.openejb.test.NumberedTestCase.runTestMethod(NumberedTestCase.java:135)
	at org.apache.openejb.test.NumberedTestCase$1.protect(NumberedTestCase.java:120)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at org.apache.openejb.test.NumberedTestCase.run(NumberedTestCase.java:123)
	at org.apache.openejb.test.NumberedTestCase.run(NumberedTestCase.java:102)
	at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
	at org.apache.openejb.test.TestSuite.run(TestSuite.java:46)
	at junit.textui.TestRunner.doRun(TestRunner.java:115)
	at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:58)
	at junit.textui.TestRunner.start(TestRunner.java:179)
	at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
	at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:98)
	at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
Caused by: java.rmi.RemoteException: The bean encountered a non-application exception.; nested exception is: 
	<4|false|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: 0
	at org.apache.openejb.core.transaction.TransactionPolicy.throwExceptionToServer(TransactionPolicy.java:206)
	... 26 more
Caused by: <4|false|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException: 0
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:798)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:759)
	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:528)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:210)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:251)
	at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.queryBeans(JpaCmpEngine.java:192)
	at org.apache.openejb.core.cmp.CmpContainer.findEJBObject(CmpContainer.java:640)
	... 24 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.openjpa.jdbc.kernel.exps.PCPath.appendTo(PCPath.java:633)
	at org.apache.openjpa.jdbc.kernel.exps.EqualExpression.appendTo(EqualExpression.java:68)
	at org.apache.openjpa.jdbc.kernel.exps.CompareEqualExpression.appendTo(CompareEqualExpression.java:95)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere(SelectConstructor.java:235)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(SelectConstructor.java:76)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects(JDBCStoreQuery.java:323)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(JDBCStoreQuery.java:165)
	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:672)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:977)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:789)
	... 30 more


> Entity name is ignored when specified in the orm.xml file
> ---------------------------------------------------------
>
>                 Key: OPENJPA-142
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-142
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Marc Prud'hommeaux
>
> The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file:
>    <entity name="Foo" class="mypackage.Bar">
> the entity will be aliased to "Bar", rather than to "Foo".
> Original report by Dain Sundstrom on the open-jpa-dev mailing list:
> I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries.  In stead it seems to always choose the class name for the schema name of the bean.  For example, I have the following bean declared in my entity mappings:
>     <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean">
>         <description>BasicCmp2Bean</description>
>         <attributes>
>             <id name="id"/>
>             <basic name="firstName"/>
>             <basic name="lastName"/>
>         </attributes>
>     </entity>
> The following query does not work:
>         SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
> But this one does:
>         SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1
> When the query fails, I get this message (reformatted a bit with ** added to important entries):
> ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{
> AllowedOperationsCmp2Bean_AOBasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean],
> AllowedOperationsCmpBean=
>   [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean],
> ContextLookupCmpBean=
>   [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean],
> Employee=
>   [class org.apache.openejb.test.entity.cmp2.Employee],
> ManyOwningSideBean_ManyOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean],
> **BasicCmp2Bean_BasicCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean],
> EncCmpBean=
>   [class org.apache.openejb.test.entity.cmp.EncCmpBean],
> BBean_OneToOneB=
>   [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB],
> OneOwningSideBean_OneOwningSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean],
> ABean_OneToOneA=
>   [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA],
> **BasicCmp2Bean=null,
> RmiIiopCmpBean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean],
> ABean_OneToManyA=
>   [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA],
> OneInverseSideBean_OneInverseSideBean=
>   [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean],
> BBean_OneToManyB=
>   [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB],
> RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean=
>   [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean],
> EncCmp2Bean_EncCmp2Bean=
>   [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean],
> BasicCmpBean=
>   [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.