protected void generateSubQueries ( Builder methodBuilder , SQLiteModelMethod method ) { SQLiteEntity entity = method . getEntity ( ) ; for ( Triple < String , String , SQLiteModelMethod > item : method . childrenSelects ) { TypeName entityTypeName = TypeUtility . typeName ( entity . getElement ( ) ) ; String setter ; if ( entity . isImmutablePojo ( ) ) { String idGetter = ImmutableUtility . IMMUTABLE_PREFIX + entity . getPrimaryKey ( ) . getName ( ) ; setter = ImmutableUtility . IMMUTABLE_PREFIX + entity . findRelationByParentProperty ( item . value0 ) . value0 . getName ( ) + "=" + String . format ( "this.daoFactory.get%s().%s(%s)" , item . value2 . getParent ( ) . getName ( ) , item . value2 . getName ( ) , idGetter ) ; } else { String idGetter = PropertyUtility . getter ( "resultBean" , entityTypeName , entity . getPrimaryKey ( ) ) ; setter = PropertyUtility . setter ( entityTypeName , "resultBean" , entity . findRelationByParentProperty ( item . value0 ) . value0 , String . format ( "this.daoFactory.get%s().%s(%s)" , item . value2 . getParent ( ) . getName ( ) , item . value2 . getName ( ) , idGetter ) ) ; } methodBuilder . addComment ( "sub query: $L" , setter ) ; methodBuilder . addStatement ( "$L" , setter ) ; } }
generate code for sub queries