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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via GitHub by sascharitter
, 1 year ago
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
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 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)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.