openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <kwsut...@gmail.com>
Subject @IdClass annotation for id field of type byte[]
Date Tue, 02 Jan 2007 23:03:17 GMT
Hi,
Some experimenting with the @IdClass support is producing a strange
exception message when attempting to map an id field of type byte[].
According to the OpenJPA documentation, we need to use an Identity Class to
use byte[] as the id field type.  Something like this:

@Entity
@IdClass (jpa.classes.Guid.class)
@Table(name="AGENT", schema="CDB")
public class Agent {

    @Id
    @Column(name="ME_GUID")
    private byte[] guid;
...

The Guid class has also been created with a single instance variable of type
byte[]:

public class Guid implements Serializable {
    private byte[] guid;
...

But, during the loading of the database, I am getting the following error...

org.apache.openjpa.util.MetaDataException: You cannot join on column "
AGENT.ME_GUID".  It is not managed by a mapping that supports joins

First off, the exception is confusing since I don't believe I am attempting
to do a join.  The guid column is in the same table as the Agent.

Also, this exception is supposedly only being produced with Oracle, not
DB2.  (I have not been able to verify that yet.)  This would seem to
indicate that it's dictionary-specific, but I'm not seeing anything there
yet...

I am in the process of validating the problem, but I thought I would drop a
line to the team to see if it rings any bells...

Thanks,
Kevin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message