OneToManyMapping mapping = (OneToManyMapping) descriptor.getMappingForAttributeName( "someRelationship" ); Expression origExp = mapping.buildSelectionCriteria(); ExpressionBuilder expBuilder = origExp.getBuilder(); Expression constantExp = expBuilder.get( "someAttribute" ).in( new String[] { "V", "W", "U" } ); Expression newExp = origExp.and( constantExp ); mapping.setSelectionCriteria( newExp );
.getClass())) { OneToManyMapping databaseMapping = ((OneToManyMapping) descriptor.getMappingForAttributeName(propertyName)); exp = databaseMapping.buildSelectionCriteria(); mapping = (ForeignReferenceMapping) databaseMapping; } else {
if (mapping.isOneToManyMapping()) { OneToManyMapping otm = (OneToManyMapping) mapping; Expression join = otm.buildSelectionCriteria(); selectionCriteria = selectionCriteria.and(join);