Permalink
Browse files

closes #9 hibernate dependency

  • Loading branch information...
1 parent 11e4af5 commit eea561598b9efa56131ddc0779d801b850449719 @fabiooshiro committed Oct 24, 2013
Showing with 6 additions and 2 deletions.
  1. +1 −1 PlasticCriteriaGrailsPlugin.groovy
  2. +5 −1 src/groovy/plastic/criteria/PlasticCriteria.groovy
@@ -1,5 +1,5 @@
class PlasticCriteriaGrailsPlugin {
- def version = "1.3"
+ def version = "1.3.1"
def grailsVersion = "1.3 > *"
def pluginExcludes = [
'grails-app/domain/**',
@@ -251,7 +251,11 @@ class PlasticCriteria {
def _handleUniqueResult(ls){
if(uniqueResult){
if(ls.size() > 1){
- throw new org.hibernate.NonUniqueResultException(ls.size())
+ try{
+ throw Class.forName('org.hibernate.NonUniqueResultException').getConstructor(Integer.TYPE).newInstance(ls.size())
+ }catch(java.lang.ClassNotFoundException e){
+ throw new RuntimeException("NonUniqueResultException: ${ls.size()}")
+ }
}else if(ls.size() == 1){
return ls[0]
}

0 comments on commit eea5615

Please sign in to comment.