users@glassfish.java.net

Can't map DiscriminatorColumn as attribute of parent class

From: <glassfish_at_javadesktop.org>
Date: Sun, 24 Jun 2007 11:51:20 PDT

Folks !

I have a simple hierarchy like this:

@DiscriminatorColumn(name="SOURCE")
class A {

  @Column(name = "source", nullable = false)
  private String source;
 --- other attributes

}

@DiscriminatorValue("B")
class B extends A {
  -- some additional attribute
}

When I try to persist B to Postgres using Glassfish Toplink Essentials, I get "duplicate column "source" error". I can see "source" being specified twice in insert statement. It works in OpenJPA though. How do you map discriminatorcolumn to be a parent class'es atribute ?

BTW, finder query to locate by "source" works and it loads B fine.

thanks,

-Sanjay
[Message sent by forum member 'femski' (femski)]

http://forums.java.net/jive/thread.jspa?messageID=223710