org.grails.core.exceptions.GrailsRuntimeException: Target of [unique] constraints [composite.id.unique.UniqueWithCompositeId : (unsaved)] is not a domain instance. Unique constraint can only be applied to domain classes and not custom user types or embedded instances

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • org.grails.core.exceptions.GrailsRuntimeException: Target of [unique] constraints [composite.id.unique.UniqueWithCompositeId : (unsaved)] is not a domain instance. Unique constraint can only be applied to domain classes and not custom user types or embedded instances at org.grails.orm.hibernate.validation.UniqueConstraint.processValidate(UniqueConstraint.java:142) at grails.validation.AbstractConstraint.validate(AbstractConstraint.java:107) at grails.validation.ConstrainedProperty.validate(ConstrainedProperty.java:979) at org.grails.validation.GrailsDomainClassValidator.validatePropertyWithConstraint(GrailsDomainClassValidator.java:211) at org.grails.validation.GrailsDomainClassValidator.validate(GrailsDomainClassValidator.java:81) at org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.save(AbstractHibernateGormInstanceApi.groovy:122) at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:151)
No Bugmate found.