openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B.J. Reed (JIRA)" <>
Subject [jira] Commented: (OPENJPA-895) InternalException when querying entity that participates in both inheritance and relationships
Date Fri, 13 Feb 2009 22:18:59 GMT


B.J. Reed commented on OPENJPA-895:

I haven't figured the root cause yet, but one way around this is to move the fetch=FetchType.EAGER
to the @ManyToOne annotation so your code would look like this.

    private Collection<Entity_1> manySide = new ArrayList<Entity_1>();
    private Entity_1 oneSide;

or you could leave off the fetch=FetchType.EAGER all together since that is the default for
the @ManyToOne annotation.

I believe that FetchType should be valid on the @OneToMany annotation and I also get a different
(similar, but different) exception when I specify FetchType.LAZY on the @OneToMany annotation.
 Seems really bizarre to me that neither work when specified.

> InternalException when querying entity that participates in both inheritance and relationships
> ----------------------------------------------------------------------------------------------
>                 Key: OPENJPA-895
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Dinkar Rao
>         Attachments:,,,
> Can someone please take a look at this  ? This is with 1.2.x.
> I have Entity_1 that is extended by Entity_11 and Entity_12. Entity_1 has a 1-m bidirectional
relationship with itself. When I query Entity_1 I get the following exception. Entities and
Test are attached.
> Thanks
> Dinkar
> Trace:
> 13349  inheritance-test  TRACE  [main] openjpa.Query - Executing query: select e from
Entity_1 e
> Exception in thread "main" <openjpa-1.2.1-SNAPSHOT-runknown fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.join(
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.join(
> 	at org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.selectEager(
> 	at org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.access$0(
> 	at org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy$
> 	at
> 	at org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.selectEagerParallel(
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.selectEagerParallel(
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.selectBaseMappings(
> 	at
> 	at
> 	at org.apache.openjpa.jdbc.sql.LogicalUnion$
> 	at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.selectIdentifier(
> 	at
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.populateSelect(
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.access$0(
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery$
> 	at
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.populateUnion(
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(
> 	at org.apache.openjpa.kernel.QueryImpl.execute(
> 	at org.apache.openjpa.kernel.QueryImpl.execute(
> 	at org.apache.openjpa.kernel.QueryImpl.execute(
> 	at org.apache.openjpa.kernel.QueryImpl.execute(
> 	at org.apache.openjpa.kernel.DelegatingQuery.execute(
> 	at org.apache.openjpa.persistence.QueryImpl.execute(
> 	at org.apache.openjpa.persistence.QueryImpl.getResultList(
> 	at Test.main(

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

View raw message