openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From depstei2 <>
Subject Re: UniqueConstraint in a MappedSuperclass not working
Date Wed, 22 Apr 2009 21:33:48 GMT

This works, but only if I have one subclass.  If there are two separate
subclasses of the Attribute class I get 
Constraint 'UNQ_ATTR_NAMEOWNER' already exists in Schema 'SERVICETEST'

It seems like openJpa is not naming these constraints uniquely, is there any
way to do this?

Hi ,

May be you are already aware, Workaround would be to use "unique constraint"
in sub class.
So in your example, 
will go to OrgAttribute and look like:
@Table(name =

I think it would be nice if the uniqueconstraint can be defined in the super
class itself.

As far as it is bug or not, may be some openJPA expert can help answer that.

According to my view, it is more of any enhancement request rather than a
My conclusion is based on following, Table annotation is for an entity class
and mappedSuperclass is a non-entity class.


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message