@ Override public Iterable < Edge > edges ( ) { if ( limit == 0 ) return Collections . emptyList ( ) ; if ( ( ( OrientBaseGraph ) graph ) . getRawGraph ( ) . getTransaction ( ) . isActive ( ) || hasCustomPredicate ( ) ) // INSIDE TRANSACTION QUERY DOESN'T SEE IN MEMORY CHANGES, UNTIL // SUPPORTED USED THE BASIC IMPL return new OrientGraphQueryIterable < Edge > ( false , labels ) ; if ( ( ( OrientBaseGraph ) graph ) . isUseLightweightEdges ( ) ) return new OrientGraphQueryIterable < Edge > ( false , labels ) ; final StringBuilder text = new StringBuilder ( 512 ) ; // GO DIRECTLY AGAINST E CLASS AND SUB-CLASSES text . append ( QUERY_SELECT_FROM ) ; if ( ( ( OrientBaseGraph ) graph ) . isUseClassForEdgeLabel ( ) && labels != null && labels . length > 0 ) { // FILTER PER CLASS SAVING CHECKING OF LABEL PROPERTY if ( labels . length == 1 ) // USE THE CLASS NAME text . append ( OrientBaseGraph . encodeClassName ( labels [ 0 ] ) ) ; else { // MULTIPLE CLASSES NOT SUPPORTED DIRECTLY: CREATE A SUB-QUERY return new OrientGraphQueryIterable < Edge > ( false , labels ) ; } } else text . append ( OrientEdgeType . CLASS_NAME ) ; List < Object > queryParams = manageFilters ( text ) ; if ( ! ( ( OrientBaseGraph ) graph ) . isUseClassForEdgeLabel ( ) ) manageLabels ( queryParams . size ( ) > 0 , text ) ; final OSQLSynchQuery < OIdentifiable > query = new OSQLSynchQuery < OIdentifiable > ( text . toString ( ) ) ; if ( fetchPlan != null ) query . setFetchPlan ( fetchPlan ) ; if ( limit > 0 && limit < Integer . MAX_VALUE ) query . setLimit ( limit ) ; return new OrientElementIterable < Edge > ( ( ( OrientBaseGraph ) graph ) , ( ( OrientBaseGraph ) graph ) . getRawGraph ( ) . query ( query , queryParams . toArray ( ) ) ) ; }
Returns the result set of the query as iterable edges .