Hi Adam,
Here's my understanding of the problem you are experiencing, please correct
me if I am wrong:
You defined a base Entity class A:
@Entity
@Table(name="A")
public class A implements Serializable {
@Id
@Column(name="ID")
public Integer getId() {
return id;
}
...
}
In case you defined derived class B without Entity annotation:
public class B extends A {
...
}
during deployment you are getting the following exception:
> Exception [TOPLINK-129] (Oracle TopLink Essentials - 2006.4 (Build
> 060412)): oracle.toplink.essentials.exceptions.DescriptorException
> Exception Description: The set method for the attribute [detailRoleName]
> does not take a ValueHolderInterface as its parameter, but the mapping
> uses indirection.
> Mapping:
> oracle.toplink.essentials.mappings.OneToOneMapping[detailRoleName]
Otherwise, if you define the derived class with Entity annotation:
@Entity
public class B extends A {
...
}
during deployment you are getting exception indicating that B has no primary
key specified
> (It should define either an @Id, @EmbeddedId or an @IdClass).
----- Original Message -----
From: "Adam Bien" <abien_at_adam-bien.com>
To: <persistence_at_glassfish.dev.java.net>
Cc: <persistence_at_glassfish.dev.java.net>
Sent: Monday, August 14, 2006 12:35 PM
Subject: Problem with inheritance...
> Problem/limitation:
>
> I generate entities with annotations (@Id, @Entity) etc.
>
> The coded classes inherit from the generated ones.
> Now I have a problem during deployment:
>
> I get either the exception:
>
> Exception [TOPLINK-129] (Oracle TopLink Essentials - 2006.4 (Build
> 060412)): oracle.toplink.essentials.exceptions.DescriptorException
> Exception Description: The set method for the attribute [detailRoleName]
> does not take a ValueHolderInterface as its parameter, but the mapping
> uses indirection.
> Mapping:
> oracle.toplink.essentials.mappings.OneToOneMapping[detailRoleName]
>
>
> if I mark the concrete-entity as @Entity or:
>
> Test Name : tests.persistence.DefaultProviderVerification
> Test Assertion : Test validity of EJB 3.0 persistence unit. This test
> tests validity using a portable persistence provider. Please refer to EJB
> 3.0 Persistence API Specification for further information.
> Test Description : For [ template#ejb-jar.jar#null ]
> Exception Description: Entity class [class ...EJBSecondDetailBE] has no
> primary key specified. It should define either an @Id, @EmbeddedId or an
> @IdClass.
>
> The primary key is specified, but in the superclass
> (AbstractSecondDetailBE). It seems, like the annotations are not
> "inherited".
>
> thanks and greetings,
>
> adam
>
>