openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Datastore identity and ReverseMappingTool
Date Fri, 12 Feb 2010 17:12:19 GMT
I am baffled at the output of the ReverseMappingTool in OpenJPA 1.2.2 when
it comes to datastore identity.

Perhaps I am missing what datastore identity is.  I had assumed that a class
conceptually has datastore identity when it has, for example, an
auto-assigned primary key.  In such a case I'd expect the ReverseMapping
tool to omit any setters for this field, and to disallow its presence in
constructors.

I'd also expect the annotations produced to involve @GeneratedValue (or
whatever it is; typing from memory).

Instead I see a syntactically invalid @PrimaryKeyJoinColumn annotation
mushed into the @Table annotation, and basically nothing else (i.e. no other
mention whatsoever of the primary key column in the mapping):

@Entity
@Table(schema="foobar", name="bizbaw", @PrimaryKeyJoinColumn(name="pk",
columnDefinition="serial"))
public class Blah {

What on *earth* is happening here?  As far as I can tell, this comes about
if I turn the useDatastoreIdentity property on in the reverse mapping tool.

I scanned the source base and then discovered that there's nothing in the
annotation serializer that even attempts to use @GeneratedValue.  Am I on my
own for this?

Thanks,
Laird

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