private EnabledEndpoint getPartialEnabledEndpointFromResultset ( ResultSet result ) throws Exception { EnabledEndpoint endpoint = new EnabledEndpoint ( ) ; endpoint . setId ( result . getInt ( Constants . GENERIC_ID ) ) ; endpoint . setPathId ( result . getInt ( Constants . ENABLED_OVERRIDES_PATH_ID ) ) ; endpoint . setOverrideId ( result . getInt ( Constants . ENABLED_OVERRIDES_OVERRIDE_ID ) ) ; endpoint . setPriority ( result . getInt ( Constants . ENABLED_OVERRIDES_PRIORITY ) ) ; endpoint . setRepeatNumber ( result . getInt ( Constants . ENABLED_OVERRIDES_REPEAT_NUMBER ) ) ; endpoint . setResponseCode ( result . getString ( Constants . ENABLED_OVERRIDES_RESPONSE_CODE ) ) ; ArrayList < Object > args = new ArrayList < Object > ( ) ; try { JSONArray arr = new JSONArray ( result . getString ( Constants . ENABLED_OVERRIDES_ARGUMENTS ) ) ; for ( int x = 0 ; x < arr . length ( ) ; x ++ ) { args . add ( arr . get ( x ) ) ; } } catch ( Exception e ) { // ignore it.. this means the entry was null/corrupt } endpoint . setArguments ( args . toArray ( new Object [ 0 ] ) ) ; return endpoint ; }
This only gets half of the EnabledEndpoint from a JDBC ResultSet Getting the method for the override id requires an additional SQL query and needs to be called after the SQL connection is released