package com.radiadesign.relationalscope

import org.hibernate.criterion.*
import org.codehaus.groovy.grails.commons.DefaultGrailsDomainClass

class NotRelationalScope extends OrRelationalScope {
  
  // --------------------------------------------------------------------------
  // Constructors
  // --------------------------------------------------------------------------
  
  NotRelationalScope(DefaultGrailsDomainClass _grailsDomainClass) {
    super(_grailsDomainClass)
  }
  
  //NotRelationalScope(JSONObject json) {
  //  super(json)
  //}
  
  protected NotRelationalScope(DefaultGrailsDomainClass _grailsDomainClass, ArrayList _scopes) {
    super(_grailsDomainClass, _scopes)
  }
  
  
  // --------------------------------------------------------------------------
  // Private API
  // --------------------------------------------------------------------------
  
  def instance() {
    new NotRelationalScope(grailsDomainClass)
  }
  
  Criterion toCriterion(options) {
    Restrictions.not( super.toCriterion( options.criteria,
                                         associationPath,
                                         options.associationAliases ) )
  }
  
}
package com.radiadesign.relationalscope

import org.hibernate.criterion.*
import org.codehaus.groovy.grails.commons.DefaultGrailsDomainClass

class NotRelationalScope extends OrRelationalScope {
  
  // --------------------------------------------------------------------------
  // Constructors
  // --------------------------------------------------------------------------
  
  NotRelationalScope(DefaultGrailsDomainClass _grailsDomainClass) {
    super(_grailsDomainClass)
  }
  
  //NotRelationalScope(JSONObject json) {
  //  super(json)
  //}
  
  protected NotRelationalScope(DefaultGrailsDomainClass _grailsDomainClass, ArrayList _scopes) {
    super(_grailsDomainClass, _scopes)
  }
  
  
  // --------------------------------------------------------------------------
  // Private API
  // --------------------------------------------------------------------------
  
  def instance() {
    new NotRelationalScope(grailsDomainClass)
  }
  
  Criterion toCriterion(options) {
    Restrictions.not( super.toCriterion( options.criteria,
                                         options.associationPath,
                                         options.associationAliases ) )
  }
  
}
Use options.associationPath instead of just associationPath.
Use options.associationPath instead of just associationPath.
