Hi,
I am trying to override the primary key mapping in subclasses. The problem is 
that the table created for the subclass keeps both two columns: the primary key 
of the superclass and the overriden mapping.
Here is the code:

@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class MyAbstractSuper {
        private Long id_MyAbstractSuper;
        @Id
        public Long getId_MyAbstractSuper() {
                return id_MyAbstractSuper;
        }
        public void setId_MyAbstractSuper(Long id_MyAbstractSuper) {
                this.id_MyAbstractSuper = id_MyAbstractSuper;
        }
}

@Entity
@Table(name="MySubClass")
@AttributeOverride(name="id_MyAbstractSuper",[EMAIL 
PROTECTED](name="id_MySubClass"))
public class MySubClass extends MyAbstractSuperclass {

        @Override
        public Long getId_MyAbstractSuperclass(){
                return super.getId_MyAbstractSuperclass();
        }
}

I read that there was a bug with javassist and tried to replace it with cglib 
but the problem still remains.

Thank you.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961283#3961283

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961283
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to