Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GrailsAnnotationConfiguration was missing the feature from DefaultGra…
…ilsDomainConfiguration to specify an alternative mapping strategy
  • Loading branch information
graemerocher committed Sep 27, 2010
1 parent 2eb3098 commit 767696f
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -53,13 +53,17 @@ public class GrailsAnnotationConfiguration extends AnnotationConfiguration imple
* @see org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainConfiguration#addDomainClass(org.codehaus.groovy.grails.commons.GrailsDomainClass)
*/
public GrailsDomainConfiguration addDomainClass(GrailsDomainClass domainClass) {
if (!AnnotationDomainClassArtefactHandler.isJPADomainClass(domainClass.getClazz())) {
if (shouldMapWithGorm(domainClass)) {
domainClasses.add(domainClass);
}

return this;
}

private boolean shouldMapWithGorm(GrailsDomainClass domainClass) {
return !AnnotationDomainClassArtefactHandler.isJPADomainClass(domainClass.getClazz()) && domainClass.getMappingStrategy().equalsIgnoreCase(GrailsDomainClass.GORM);
}

/* (non-Javadoc)
* @see org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainConfiguration#setGrailsApplication(org.codehaus.groovy.grails.commons.GrailsApplication)
*/
Expand Down

0 comments on commit 767696f

Please sign in to comment.