All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.java.ServiceGrpcServerSelectImpl.template Maven / Gradle / Ivy


    @Override
        public void @service_name@(WriteBase writer, AbstractBackendController.ReqRes<@service_request@, @service_response@> reqres,
        List> prevSteps, ServiceContext context) {

        @service_request@ request = reqres.request;
        try {

            List<@service_response@VO> recordList = null;
            @[email protected] responseBuilder = null;

            Object[] paramValues = null;
            @paramValues@

            String sqlStmt = SqlStmts.@service_name@;
            @sqlreplace@
            recordList = new @service_response@Dao().execute( sqlStmt, paramValues );
            responseBuilder = @[email protected]().setStatus(OK).setCount(recordList.size());

            if (BackendControllerFactory.getInstance().pipelines != null) {
                for (AbstractBackendController pipeline : BackendControllerFactory.getInstance().pipelines)
                    pipeline.onData@service_name@(writer, recordList, responseBuilder, reqres, prevSteps,  context);
                if ( null != reqres.response) return;
            }

            if ( ! context.manualOverride) {
                @add_records@
                reqres.response = responseBuilder.build();
            }


        } catch (Exception ex) {
            LOG.info("ERROR while processing ListFarmers", ex);
            ex.printStackTrace();

            if (BackendControllerFactory.getInstance().pipelines != null) {
                for (AbstractBackendController pipeline : BackendControllerFactory.getInstance().pipelines)
                    pipeline.onError@service_name@(reqres, prevSteps, context, ex);
            }

        }

    }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy