openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JohnLloydJones <john.lloydjo...@gmail.com>
Subject StoreException when accessing inherited PersistantMap attribute
Date Fri, 12 Jun 2009 14:02:50 GMT

I am using openjpa 1.2.1 and I have a DomEntity superclass:
@MappedSuperclass
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class DomEntity
{
   @Column(name="id")
   @Id
   @SequenceGenerator(name = "EntitySeq", allocationSize=100,
sequenceName="native()")
   @GeneratedValue(strategy=GenerationType.TABLE, generator = "EntitySeq")
   long mId;

   @PersistentMap(fetch=FetchType.EAGER)
   private Map <String, String> mProperties;

   ... other stuff
}
...and extend it like this:
@Entity
@Table(name="f")
public class F extends DomEntity
{
...
}

For each subclass, I get a properties table. E.g. f_properties with columns
F_ID, KEY0, VALUE

When I try to run the app, it thows an exception. Note that the SQL is
trying to reference the non-existant column "t0.KEY03".

NativeException org.apache.openjpa.util.StoreException: ORA-00904:
"T0"."KEY03": invalid identifier {prepstmnt 8593958 SELECT t0.KEY03,
t0.value FROM f_properties t0 WHERE t0.F_ID = ? [params=(long) 6]}
[code=904, state=42000]:

    * org/apache/openjpa/jdbc/sql/DBDictionary.java:4232:in `narrow'
    * org/apache/openjpa/jdbc/sql/DBDictionary.java:4197:in
`newStoreException'
    * org/apache/openjpa/jdbc/sql/SQLExceptions.java:102:in `getStore'
    * org/apache/openjpa/jdbc/sql/SQLExceptions.java:88:in `getStore'
    * org/apache/openjpa/jdbc/sql/SQLExceptions.java:64:in `getStore'
    * org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java:694:in `load'
    * org/apache/openjpa/kernel/DelegatingStoreManager.java:116:in `load'
    * org/apache/openjpa/kernel/ROPStoreManager.java:78:in `load'
    * org/apache/openjpa/kernel/StateManagerImpl.java:2921:in `loadFields'
    * org/apache/openjpa/kernel/StateManagerImpl.java:2999:in `loadField'
    * org/apache/openjpa/kernel/StateManagerImpl.java:2242:in
`fetchObjectField'
    * org/apache/openjpa/kernel/StateManagerImpl.java:778:in `fetchField'
    * org/apache/openjpa/kernel/StateManagerImpl.java:740:in `fetch'
    * org/apache/openjpa/enhance/RedefinitionHelper.java:230:in `invoke'
    * $Proxy23:-1:in `get'

This looks like a openjpa bug to me. Am I doing something wrong? Is there a
workaround or better way to do this?
-- 
View this message in context: http://n2.nabble.com/StoreException-when-accessing-inherited-PersistantMap-attribute-tp3067804p3067804.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message