Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] EmbeddedId in superclass

Sounds like a bug in our TABLE_PER_CLASS support.

Please try the 2.1 release, and if still broken please log a bug a vote for
it.

As a workaround you can use another inheritance type, such as
@MappedSuperclass or JOINED.
You could also probably use a DescriptorCustomizer to set the
classDescriptor's primaryKeyFields in code.


shawnh wrote:
> 
> i have these classes.
> 
> @Embeddable
> public class ProductId implements Serializable{
>     private String supp;
>     private String lot;
> }
> 
> @Entity
> @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
> public abstract class AbstractStore implements Serializable {
>     @EmbeddedId
>     protected ProductId id;
>     protected Integer dept;
> }
> 
> @Entity
> @Table(name = "SM_STORE")
> public class SmStore extends AbstractStore implements Serializable {
> }
> 
> when deploy to glassfish, eclipse link gives following exception:
> 
> Local Exception Stack:
> Exception [EclipseLink-0] (Eclipse Persistence Services -
> 2.0.0.v20091127-r5931):
> org.eclipse.persistence.exceptions.IntegrityException
> Descriptor Exceptions:
> ---------------------------------------------------------
> 
> Exception [EclipseLink-74] (Eclipse Persistence Services -
> 2.0.0.v20091127-r5931):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The primary key fields are not set for this
> descriptor.
> Descriptor: RelationalDescriptor(com.comany.SmStore -->
> [DatabaseTable(SM_STORE)])
> 
> am i missing something.
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/EmbeddedId-in-superclass-tp28932574p28971888.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top