Created
April 14, 2011 08:15
-
-
Save olivermt/919113 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String, Integer>listDistinctDepositionalEnvironments(query) { | |
HibernateCriteriaBuilder builder = OutcropSection.createCriteria() | |
Collection results = builder.list { | |
resultTransformer(AliasToEntityMapResultTransformer.INSTANCE) | |
query.modern ? isNotNull("modernDepositionalSetting") : isNotNull("depositionalSetting") | |
eq("grossDepositionalEnvironment", query.grossDepEnv) | |
depositionalSetting { | |
if(query.basinType) 'in'("basinType", query.basinType) | |
if(query.paleoClimate)'in'("paleoClimate", query.paleoClimate) | |
} | |
depositionalEnvironment { | |
if(query.depEnv) 'in'("type", query.depEnv) | |
subEnvironment { | |
if(query.subDepEnv) 'in'("type", query.subDepEnv) | |
isNotEmpty("architecturalElement") //to not get back outcrops that does not have archielements | |
architecturalElement { | |
if(query.archiEleType) 'in'("type", query.archiEleType) | |
isNotNull("avgGeometry") | |
} | |
} | |
} | |
projections { | |
depositionalEnvironment { | |
groupProperty("type", "keyName") | |
subEnvironment { | |
architecturalElement { | |
count("id", "countValue") | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment