Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Does EclipseLink support Primary Key-Less Entities?

In short yes.  Note that the Entities Id does not have to have a primary key
constraint on the database, or be the primary key of the table (although it
almost always is, and should be).  Any set of unique fields will do.

If you truly have no set of unique fields, then using them all should be
fine.  Even if two objects had all the same fields, they would effectively
be the same object anyway, as they would have all of the same data.

See also:

Tim Hollosy wrote:
> I know the JPA spec requires a Primary Key for an entity.
> What's the recommended way to get around this with views without a
> primary key? Just do a large compound primary key that's pretty safe
> to be unique?
> Thanks,
> Tim

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top