method2testcases stringlengths 118 6.63k |
|---|
### Question:
ManageTagController { @GetMapping("/manageTagAdd") public String toAdd() { return "_tagOperator.html"; } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage/tagDetail") String detail(@RequestParam String name, Model model); @GetMapping("/manage/tagE... |
### Question:
ManageCommonProblemController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Login.ROLE_LOOK + "')") @GetMapping("/manage/commonProblem") public String index() { return "operation-management/_helpCenter.html"; } @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER ... |
### Question:
ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttr... |
### Question:
ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") public String index() { return "_depotManage.html"; } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageD... |
### Question:
ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/depotList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new DepotRows(time -> conversionService.convert(t... |
### Question:
InitService { @PostConstruct @Transactional @Order(Ordered.HIGHEST_PRECEDENCE) public void init() throws IOException, SQLException { commons(); database(); upgrade(); managers(); productTypes(); depots(); products(); others(); mainOrderService.createExecutorToForPayOrder(); applicationEventPublisher.publi... |
### Question:
ManageDepotController { @PostMapping("/manage/depotList") public String add(String name, Address address, String haierCode, String type, String chargePeopleName , String chargePeopleMobile) { Depot depot; if ("HaierDepot".equalsIgnoreCase(type)) { HaierDepot haierDepot = new HaierDepot(); haierDepot.setHa... |
### Question:
ManageDepotController { @PutMapping("/manage/depotList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(false); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+... |
### Question:
ManageDepotController { @PutMapping("/manage/depotList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(true); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')... |
### Question:
ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory") public String index() { return "_factoryManage.html"; } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/m... |
### Question:
ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/factoryList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new RowDefinition<Factory>() { @Override publ... |
### Question:
ManageFactoryController { @PostMapping("/manage/factoryList") public String add(String name, Address address, String chargePeopleName , String chargePeopleMobile) { Factory factory = new Factory(); factory.setEnable(true); factory.setCreateTime(LocalDateTime.now()); factory.setName(name); factory.setAddre... |
### Question:
ManageFactoryController { @PutMapping("/manage/factoryList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(false); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE... |
### Question:
ManageFactoryController { @PutMapping("/manage/factoryList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(true); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LO... |
### Question:
WechatMyController { private String myTeam(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (loginService.isRegularLogin(login)) model.addAttribute("agentLevel", agentService.loginTitle(agentService.highestAgent(login))); else model.addAttrib... |
### Question:
WechatShareController { @GetMapping(SystemService.wechatShareUri) public String share(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (!loginService.isRegularLogin(login) && !loginService.allowShare(login)) return "redirect:" + SystemService... |
### Question:
MiscController { @RequestMapping(method = RequestMethod.POST, value = "/misc/sendRegisterCode") @ResponseBody public ApiResult sendRegisterCode(String mobile) throws IOException { if (loginService.byLoginName(mobile) != null) { return ApiResult.withCodeAndMessage(401, "该手机号码已被人使用", null); } verificationCo... |
### Question:
WechatController { @GetMapping("/wechatForward/{goodId}_{id}") public String wechatForward(@OpenId String openId,@PathVariable Long goodId,@PathVariable Long id , HttpServletRequest request, HttpServletResponse response){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication... |
### Question:
WechatCommonProblemController { @GetMapping(SystemService.helpCenterURi) public String index(){ return "wechat@helpCenter/index.html"; } @GetMapping("/commonProblemDetail/{id}") String commonProblemDetail(@PathVariable Long id, Model model); @GetMapping("/commonProblem/search") @ResponseBody Map<String, ... |
### Question:
WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servlet... |
### Question:
WelcomeController { @RequestMapping(method = RequestMethod.GET, value = {"", "/"}) public String index(@AuthenticationPrincipal Login login, @HighestAgent AgentLevel agentLevel) { if (login.isManageable()) return "redirect:/manage"; if (agentLevel != null) return "redirect:/agentMain"; throw new IllegalSt... |
### Question:
CommissionController { public static String formatCommonInfo(Object origin) { String src = origin.toString(); int index = src.lastIndexOf("¥"); String first = src.substring(0, index - 1); return first + Money.format.format(new BigDecimal(src.substring(index + 1))); } static String formatCommonInfo(Object... |
### Question:
AgentNavigateController { @RequestMapping(method = RequestMethod.GET, value = "/agentMain") public String agentMain(@AuthenticationPrincipal Login login, @HighestAgent AgentLevel agentLevel, Model model) { if (login.isManageable()) { model.addAttribute("title", "管理后台"); model.addAttribute("loginAs", login... |
### Question:
LoginDataController { @PreAuthorize("!isAnonymous()") @GetMapping("/loginData/select2") @RowCustom(dramatizer = Select2Dramatizer.class, distinct = true) public RowDefinition<Login> searchLoginSelect2(String search, Boolean agent, Integer level) { return searchLogin(search, agent, level); } @GetMapping("... |
### Question:
AgentController { @GetMapping("/addAgent") @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_AllAgent + "')") public String indexForAdd() { return "addAgent.html"; } @GetMapping("/agentManage") String index(@AuthenticationPrincipal Login login); @GetMapping("/agentDetail") String detail(long id, Model mod... |
### Question:
ResourceController { @RequestMapping(method = RequestMethod.POST, value = "/webUploader") public ResponseEntity<?> webUploader(String id, MultipartFile file) throws IOException, URISyntaxException { try (InputStream inputStream = file.getInputStream()) { String path = uploadTempResource(inputStream, file)... |
### Question:
ManageAgentController extends AbstractLoginDetailController { @PutMapping("/agent/superior/{id}") @PreAuthorize("hasAnyRole('ROOT')") @ResponseBody @Transactional public ApiResult changeSuperior(@RequestBody String newGuide, @PathVariable("id") long id) { final AgentLevel target = agentService.getAgent(id... |
### Question:
ManageTagController { @GetMapping("/manageTag") public String index() { return "_tagManage.html"; } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage/tagDetail") String detail(@RequestParam String name, Model model); @GetMapping("/manage/tagEdit")... |
### Question:
ManageTagController { @GetMapping("/manage/tagList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new TagRows(time -> conversionService.convert(time, String.class)) { @Override public Specification<Tag> specification() { return null; } }; }... |
### Question:
DrillOptiq { public static LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr) { final RexToDrill visitor = new RexToDrill(context, input); return expr.accept(visitor); } static LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr); static boolean... |
### Question:
MaterializedField { public MaterializedField clone() { return withPathAndType(getPath(), getType()); } private MaterializedField(SchemaPath path, MajorType type); private MaterializedField(SchemaPath path, MajorType type, LinkedHashSet<MaterializedField> children); static MaterializedField create(Serial... |
### Question:
Driver implements java.sql.Driver { @Override public int getMajorVersion() { return impl.getMajorVersion(); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropertyInfo( String url... |
### Question:
Driver implements java.sql.Driver { @Override public int getMinorVersion() { return impl.getMinorVersion(); } Driver(); static boolean load(); @Override Connection connect( String url, Properties info ); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropertyInfo( String url... |
### Question:
TypeConvertingSqlAccessor implements SqlAccessor { @Override public float getFloat( int rowOffset ) throws InvalidAccessException { final float result; switch ( getType().getMinorType() ) { case FLOAT4: result = innerAccessor.getFloat( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOffset... |
### Question:
TypeConvertingSqlAccessor implements SqlAccessor { @Override public double getDouble( int rowOffset ) throws InvalidAccessException { final double result; switch ( getType().getMinorType() ) { case FLOAT8: result = innerAccessor.getDouble( rowOffset ); break; case INT: result = innerAccessor.getInt( rowOf... |
### Question:
ModelExtractor { public byte[] getModel(String modelUri) { return getModel(new DefaultResourceLoader().getResource(modelUri)); } ModelExtractor(); ModelExtractor(String frozenGraphFileExtension); byte[] getModel(String modelUri); byte[] getModel(Resource modelResource); final String frozenGraphFileExten... |
### Question:
PropertyUtils { public static <T> T get(String key, Function<String, T> parser, T defaultValue) { return get(System.getProperties(), key, parser, defaultValue); } private PropertyUtils(); static T get(String key, Function<String, T> parser, T defaultValue); static T get(Properties props, String key, Func... |
### Question:
PropertyUtils { public static Properties filter(String keyPrefix, Properties props) { final Properties filtered = new Properties(); final Enumeration<?> keys = props.propertyNames(); while (keys.hasMoreElements()) { final String key = (String) keys.nextElement(); final String value = props.getProperty(key... |
### Question:
StochasticOscillator implements Indicator { private static <T> void add(List<T> list, T value, int cap) { list.add(value); while (list.size() > cap) list.remove(0); } StochasticOscillator(int lookback, int kPeriod); @Override StochasticOutput add(Bar bar); }### Answer:
@Test public void test() { final St... |
### Question:
PropertyUtils { public static <T> T getOrSet(Properties props, String key, Function<String, T> parser, T defaultValue) { final String str = props.getProperty(key); if (str == null) { props.setProperty(key, String.valueOf(defaultValue)); return defaultValue; } else { return parser.apply(str); } } private ... |
### Question:
PropertyUtils { public static Properties load(String resourceFile) throws IOException { final URL url = PropertyUtils.class.getClassLoader().getResource(resourceFile); if (url == null) throw new FileNotFoundException("Resource not found"); final Properties props = new Properties(); try (InputStream in = u... |
### Question:
MidaoFactory { public static QueryRunnerService getQueryRunner(DataSource ds) { return (QueryRunnerService) ProfilerFactory.newInstance(new QueryRunner(ds)); } static QueryRunnerService getQueryRunner(DataSource ds); static QueryRunnerService getQueryRunner(DataSource ds, Class<? extends TypeHandler> typ... |
### Question:
QueryParameters { public Object getValueByPosition(Integer position) throws NoSuchFieldException { String name = null; Object value = null; name = this.getNameByPosition(position); if (name != null) { value = this.getValue(name); } else { throw new NoSuchFieldException(); } return value; } QueryParameters... |
### Question:
QueryParameters { public void importValues(Map<String, Object> map) { for (String key : map.keySet()) { this.set(key, map.get(key)); } } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParamete... |
### Question:
QueryParameters { public QueryParameters setClassName(String className) { InputUtils.setClassName(this.values, className); return this; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParamet... |
### Question:
QueryParameters { public QueryParameters updateType(String key, Integer type) { this.types.put(processKey(key), type); return this; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(... |
### Question:
QueryParameters { public QueryParameters updateDirection(String key, Direction direction) { this.direction.put(processKey(key), direction); return this; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameter... |
### Question:
QueryParameters { public QueryParameters updatePosition(String key, Integer position) { while (this.order.size() < position + 1) { this.order.add(null); } this.order.set(position, processKey(key)); return this; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz... |
### Question:
QueryParameters { public QueryParameters updateValue(String key, Object value) { this.values.put(processKey(key), value); return this; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParamete... |
### Question:
QueryParameters { public Integer getFirstPosition(String key) { int position = -1; String processedKey = processKey(key); if (this.values.containsKey(processedKey) == true) { position = this.order.indexOf(processedKey); } return position; } QueryParameters(); QueryParameters(Map<String, Object> map); Qu... |
### Question:
QueryParameters { public Direction getDirection(String key) { return this.direction.get(processKey(key)); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedIn... |
### Question:
QueryParameters { public Integer getType(String key) { return this.types.get(processKey(key)); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInput); Quer... |
### Question:
MidaoFactory { public static DataSource createDataSource(Properties poolProperties) throws SQLException { try { return MidaoFrameworkPoolBinder.createDataSource(poolProperties); } catch (NoClassDefFoundError ex) { throw new NoClassDefFoundError(ERROR_COULDNT_FIND_POOL_PROVIDER); } } static QueryRunnerSer... |
### Question:
QueryParameters { public Object getValue(String key) { return this.values.get(processKey(key)); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInput); Que... |
### Question:
QueryParameters { public Map<String, Object> toMap() { return new HashMap<String, Object>(this.values); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInpu... |
### Question:
QueryParameters { public Set<String> keySet() { return this.values.keySet(); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInput); QueryParameters(Object... |
### Question:
QueryParameters { public boolean isOutParameter(String key) { boolean isOut = false; if (this.getDirection(processKey(key)) == Direction.INOUT || this.getDirection(processKey(key)) == Direction.OUT) { isOut = true; } return isOut; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParam... |
### Question:
QueryParameters { public boolean isInParameter(String key) { boolean isIn = false; if (this.getDirection(processKey(key)) == Direction.INOUT || this.getDirection(processKey(key)) == Direction.IN) { isIn = true; } return isIn; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters... |
### Question:
QueryParameters { public String getNameByPosition(Integer position) { String name = null; name = this.order.get(position); return name; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParamet... |
### Question:
QueryParameters { public boolean containsKey(String key) { return this.values.containsKey(processKey(key)); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processed... |
### Question:
QueryParameters { public void remove(String key) { String processedKey = processKey(key); String orderKey = null; for (int i = 0; i < this.order.size(); i++) { orderKey = this.order.get(i); if (orderKey != null && orderKey.equals(processedKey) == true) { this.order.remove(i); } } this.types.remove(process... |
### Question:
QueryParameters { public int size() { return this.values.size(); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInput); QueryParameters(Object... params);... |
### Question:
QueryParameters { public void setCaseSensitive(boolean newValue) { this.isCaseSensitive = newValue; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInput); ... |
### Question:
QueryParameters { public boolean isCaseSensitive() { return this.isCaseSensitive; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedInput); QueryParameters(O... |
### Question:
QueryParameters { public void setReturn(Object queryOutput) { this.set(QUERY_PARAMS_RETURN, queryOutput); } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParameters(ProcessedInput processedIn... |
### Question:
QueryParameters { public Object getReturn() { Object result = null; if (this.containsKey(QUERY_PARAMS_RETURN) == true) { result = this.getValue(QUERY_PARAMS_RETURN); } return result; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParame... |
### Question:
QueryParameters { public void removeReturn() { if (this.containsKey(QUERY_PARAMS_RETURN) == true) { this.remove(QUERY_PARAMS_RETURN); } } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); QueryParamet... |
### Question:
QueryParameters { public void update(Object[] newValues, boolean updateOutOnly) { AssertUtils.assertNotNull(newValues); if (newValues.length != this.values.size()) { throw new IllegalArgumentException(ERROR_INCORRECT_LENGTH); } this.assertIncorrectOrder(); String parameterName = null; for (int i = 0; i < ... |
### Question:
QueryParameters { public void updateAndClean(ProcessedInput processedInput) { List<String> processedParameters = new ArrayList<String>(); if (processedInput.getAmountOfParameters() > 0) { String parameterName = null; for (int i = 0; i < processedInput.getAmountOfParameters(); i++) { parameterName = proces... |
### Question:
QueryParameters { public Object[] getValuesArray() { this.assertIncorrectOrder(); Object[] params = new Object[this.order.size()]; String parameterName = null; for (int i = 0; i < this.order.size(); i++) { parameterName = this.getNameByPosition(i); params[i] = this.getValue(parameterName); } return params... |
### Question:
QueryParameters { public boolean isOrderSet() { boolean result = true; if (this.values.size() != this.order.size()) { result = false; } return result; } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters)... |
### Question:
QueryParameters { public void assertIncorrectOrder() { if (this.isOrderSet() == false) { throw new IllegalArgumentException(ERROR_ORDER_NOT_INIT); } } QueryParameters(); QueryParameters(Map<String, Object> map); QueryParameters(Class<?> clazz, Object bean); QueryParameters(QueryParameters parameters); ... |
### Question:
BaseExceptionHandler implements ExceptionHandler { public BaseExceptionHandler(String dbName) { this.dbName = dbName; } BaseExceptionHandler(String dbName); MjdbcSQLException convert(Connection conn, SQLException cause, String sql, Object... params); }### Answer:
@Test public void testBaseExceptionHandle... |
### Question:
ProcessedInput { public void addParameter(String parameterName, int parameterStart, int parameterEnd, String parameterType, String parameterDirection) { if (this.sqlParameterNames == null) { this.sqlParameterNames = new ArrayList<String>(); this.sqlParameterBoundaries = new ArrayList<int[]>(); } this.sqlP... |
### Question:
ProcessedInput { public String getOriginalSql() { return originalSql; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql, List<String> sqlParameterNames, List<int[]> sqlParameterBoundaries, List<Object> sqlParameterVal... |
### Question:
ProcessedInput { public String getParsedSql() { return parsedSql; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql, List<String> sqlParameterNames, List<int[]> sqlParameterBoundaries, List<Object> sqlParameterValues,... |
### Question:
ProcessedInput { public List<String> getSqlParameterNames() { return sqlParameterNames; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql, List<String> sqlParameterNames, List<int[]> sqlParameterBoundaries, List<Objec... |
### Question:
ProcessedInput { public List<int[]> getSqlParameterBoundaries() { return sqlParameterBoundaries; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql, List<String> sqlParameterNames, List<int[]> sqlParameterBoundaries, L... |
### Question:
ProcessedInput { public List<Object> getSqlParameterValues() { return sqlParameterValues; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql, List<String> sqlParameterNames, List<int[]> sqlParameterBoundaries, List<Obj... |
### Question:
ProcessedInput { public void setParsedSql(String parsedSql) { this.parsedSql = parsedSql; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql, List<String> sqlParameterNames, List<int[]> sqlParameterBoundaries, List<Obj... |
### Question:
ProcessedInput { public void setSqlParameterValues(List<Object> sqlParameterValues) { if (sqlParameterValues != null) { this.sqlParameterValues = new ArrayList<Object>(sqlParameterValues); } else { this.sqlParameterValues = null; } } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput proce... |
### Question:
ProcessedInput { public Integer getPosition(String parameterName) { Integer position = null; for (int i = 0; i < this.sqlParameterNames.size(); i++) { if (this.sqlParameterNames.get(i).equals(parameterName) == true) { position = i; break; } } return position; } ProcessedInput(String originalSql); Process... |
### Question:
ProcessedInput { public String getParameterName(Integer position) { String name = null; if (this.sqlParameterNames != null) { name = this.sqlParameterNames.get(position); } return name; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql... |
### Question:
ExceptionUtils { public static void rethrow(MjdbcException cause) throws MjdbcSQLException { MjdbcSQLException ex = new MjdbcSQLException(cause.getMessage()); ex.setStackTrace(cause.getStackTrace()); throw ex; } static void rethrow(MjdbcException cause); }### Answer:
@Test public void testRethrow() { tr... |
### Question:
ProcessedInput { public Integer getAmountOfParameters() { Integer size = 0; if (this.sqlParameterNames != null) { size = this.sqlParameterNames.size(); } return size; } ProcessedInput(String originalSql); ProcessedInput(ProcessedInput processedInput); ProcessedInput(String originalSql, String parsedSql,... |
### Question:
ProcessedInput { public boolean isFilled() { boolean isFilled = false; if (this.originalSql != null && this.originalSql.length() > 0) { if (this.parsedSql != null && this.parsedSql.length() > 0) { if (this.sqlParameterNames != null) { if (this.sqlParameterValues != null) { isFilled = true; } } } } return ... |
### Question:
ProcessedInput { public void fillParameterValues(Map<String, Object> valuesMap) { AssertUtils.assertNotNull(valuesMap, "Value map cannot be null"); if (this.sqlParameterNames != null) { String parameterName = null; this.sqlParameterValues = new ArrayList<Object>(); for (int i = 0; i < this.sqlParameterNam... |
### Question:
EmptyTypeHandler implements TypeHandler { public QueryParameters processInput(Statement stmt, QueryParameters params) { return params; } EmptyTypeHandler(Overrider overrider); QueryParameters processInput(Statement stmt, QueryParameters params); void afterExecute(Statement stmt, QueryParameters processedI... |
### Question:
EmptyTypeHandler implements TypeHandler { public void afterExecute(Statement stmt, QueryParameters processedInput, QueryParameters params) { } EmptyTypeHandler(Overrider overrider); QueryParameters processInput(Statement stmt, QueryParameters params); void afterExecute(Statement stmt, QueryParameters proc... |
### Question:
EmptyTypeHandler implements TypeHandler { public List<QueryParameters> processOutput(Statement stmt, List<QueryParameters> paramsList) { return paramsList; } EmptyTypeHandler(Overrider overrider); QueryParameters processInput(Statement stmt, QueryParameters params); void afterExecute(Statement stmt, Query... |
### Question:
TypeHandlerUtils { public static Object convertArray(Connection conn, Object[] array) throws SQLException { Object result = null; result = createArrayOf(conn, convertJavaClassToSqlType(array.getClass().getComponentType().getSimpleName()), array); return result; } static Object convertArray(Connection con... |
### Question:
TypeHandlerUtils { public static Object convertBlob(Connection conn, byte[] value) throws SQLException { Object result = createBlob(conn); result = convertBlob(result, value); return result; } static Object convertArray(Connection conn, Object[] array); static Object convertArray(Connection conn, Collect... |
### Question:
MidaoLogger extends Logger { public static MidaoLogger getLogger(String name) { MidaoLogger mjdbcLogger = new MidaoLogger(name, null); if (isSLF4jAvailable() == true) { try { mjdbcLogger = new MidaoLogger(name, null); mjdbcLogger.setSlfLogger(MappingUtils.invokeStaticFunction(Class.forName("org.slf4j.Logg... |
### Question:
TypeHandlerUtils { public static Object convertClob(Connection conn, byte[] value) throws SQLException { Object result = (Object) createClob(conn); result = convertClob(result, value); return result; } static Object convertArray(Connection conn, Object[] array); static Object convertArray(Connection conn... |
### Question:
TypeHandlerUtils { public static Object convertSqlXml(Connection conn, byte[] value) throws SQLException { Object result = createSQLXML(conn); result = convertSqlXml(result, value); return result; } static Object convertArray(Connection conn, Object[] array); static Object convertArray(Connection conn, C... |
### Question:
TypeHandlerUtils { public static String convertJavaClassToSqlType(String simpleClassName) throws SQLException { if ("String".equals(simpleClassName) == true) { return "VARCHAR"; } throw new SQLException(String.format("Could not convert java class %s", simpleClassName)); } static Object convertArray(Conne... |
### Question:
TypeHandlerUtils { public static byte[] readBlob(Object blob, boolean close) throws SQLException { byte[] result = null; InputStream input = null; try { input = (InputStream) MappingUtils.invokeFunction(blob, "getBinaryStream", new Class[]{}, new Object[]{}); } catch (MjdbcException ex) { throw new MjdbcS... |
### Question:
TypeHandlerUtils { public static byte[] readClob(Object clob, boolean close) throws SQLException { byte[] result = null; InputStream input = null; try { input = (InputStream) MappingUtils.invokeFunction(clob, "getAsciiStream", new Class[]{}, new Object[]{}); } catch (MjdbcException ex) { throw new MjdbcSQ... |
### Question:
MidaoLogger extends Logger { @Override public void info(String msg) { if (isSLF4jAvailable() == false) { super.info(msg); } else { try { MappingUtils.invokeFunction(slfLogger, "info", new Class[]{String.class}, new Object[]{msg}); } catch (MjdbcException e) { setSLF4jAvailable(false); super.info(msg); } }... |
### Question:
TypeHandlerUtils { public static byte[] readSqlXml(Object sqlXml, boolean close) throws SQLException { byte[] result = null; InputStream input = null; try { input = (InputStream) MappingUtils.invokeFunction(sqlXml, "getBinaryStream", new Class[]{}, new Object[]{}); } catch (MjdbcException ex) { throw new ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.