private Object getObject ( final Object _object ) throws EFapsException { final Object ret ; // inside a fromobject the correct value must be set if ( this . fromSelect != null && _object instanceof Number ) { final List < Object > tmpList = new ArrayList <> ( ) ; final Long id = ( ( Number ) _object ) . longValue ( ) ; Iterator < Long > relIter = this . relIdList . iterator ( ) ; // chained linkfroms if ( ! getSelectParts ( ) . isEmpty ( ) && getSelectParts ( ) . get ( 0 ) instanceof LinkFromSelect . LinkFromSelectPart && ! ( ( ( LinkFromSelect . LinkFromSelectPart ) getSelectParts ( ) . get ( 0 ) ) . getType ( ) instanceof AttributeSet ) ) { relIter = this . idList . iterator ( ) ; } else { relIter = this . relIdList . iterator ( ) ; } final Iterator < Object > objIter = this . objectList . iterator ( ) ; while ( relIter . hasNext ( ) ) { final Long rel = relIter . next ( ) ; final Object obj = objIter . next ( ) ; if ( rel . equals ( id ) ) { tmpList . add ( obj ) ; } } if ( this . valueSelect == null ) { final List < Object > retTmp = new ArrayList <> ( ) ; for ( final Object obj : tmpList ) { retTmp . add ( this . fromSelect . getMainOneSelect ( ) . getObject ( obj ) ) ; } ret = retTmp . size ( ) > 0 ? retTmp . size ( ) > 1 ? retTmp : retTmp . get ( 0 ) : null ; } else { ret = this . valueSelect . getValue ( tmpList ) ; } } else { ret = this . getObject ( ) ; } return ret ; }
Get an object from a n to 1 Relation . Therefore the given object is used to filter only the valid values from the by the Database returned objects .