method

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.baway.dao.UserMapper.register

社会主义新天地 提交于 2019-12-17 02:22:51
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.baway.dao.UserMapper.register at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) at com.sun.proxy.$Proxy13.register(Unknown Source) at com.baway.service.impl.UserserviceImpl.addUser(UserserviceImpl.java:19) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native

refactoring tools使用指南

守給你的承諾、 提交于 2019-12-17 02:01:14
Refactoring 一、 Encapsulate Field (封装值域) There is a public field. Make it private and provide accessors. public String _name private String _name; public String getName() {return _name;} public void setName(String arg) {_name = arg;} 二、 Extract Method (提炼函数) You have a code fragment that can be grouped together. Turn the fragment into a method whose name explains the purpose of the method. void printOwing() { printBanner(); //print details System.out.println ("name: " + _name); System.out.println ("amount " + getOutstanding()); } void printOwing() { printBanner(); printDetails(getOutstanding())

代理的分析

这一生的挚爱 提交于 2019-12-15 11:54:46
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.learn</groupId> <artifactId>day03_learn_02proxy</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <dependencies> <dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>2.1_3</version> </dependency> </dependencies> </project> package com.learn.cglib; import net.sf

springmvc register过程

余生长醉 提交于 2019-12-11 21:11:39
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 首先在AbstractHandlerMethodMapping中,在afterPropertiesSet这个钩子函数中,先初始化handlerMethods。 在detectHandlerMethods中,获取如下map // key值为method value为 RequestMappingInfo 这个类标明了该方法的条件 包括url以及http方法等等信息 Map<Method, T> methods = MethodIntrospector.selectMethods(userType, (MethodIntrospector.MetadataLookup<T>) method -> { try { return getMappingForMethod(method, userType); } catch (Throwable ex) { throw new IllegalStateException("Invalid mapping on handler class [" + userType.getName() + "]: " + method, ex); } }); 注册的过程在方法中进行 // mapping 的信息 handler为该方法的bean的name method为方法 public

SpringAOP中切入点的高级使用

旧时模样 提交于 2019-12-11 00:41:49
上一篇 SpringAOP之使用切入点创建通知 SpringAOP中切点的高级使用 一、使用控制流切入点(ControlFlowPointcut) 什么是控制流切入点呢?看下面的代码(为了方便,就写进了一个公共类) class Cat { public void talk() { System.out.println("I am a cat"); } public void play() { System.out.println("I am palying"); } } class BlackCat { public void sleep(Cat cat) { cat.play(); System.out.println("I am a blackCat , I am sleeping"); } } /** * 创建前置通知类 */ class BeforeAdvice implements MethodBeforeAdvice{ @Override public void before(Method method, Object[] objects, @Nullable Object o) throws Throwable { System.out.println("这个方法被通知了"+method); } } 需求:我们要给Cat的play()方法进行通知,但是呢

Cannot fetch LAZY - JPA

亡梦爱人 提交于 2019-12-10 15:25:03
问题 I want to do LAZY loading in a OneToMany Relation in JPA. The Problem is, that when i want to acces the LAZY loaded Attribute i get a exception. I know that i have to be in a Transaction when trying to access the attribute. But it seems like the Transaction is not open. This is the exception: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: de.recipemanager.recipe.data.Recipe.ingredients, could not initialize proxy - no Session at org.hibernate

Python的method, class method, static method

馋奶兔 提交于 2019-12-09 20:03:57
method是类的成员函数,必须由类的实例来调用,可以访问类的实例,第一个参数默认是实例。 class method可以由类,类的实例来调用,但第一个参数默认是类 static method可以由类,类的实例来调用,没有默认参数 class A : def __init__ (self) : self.i = 1 @classmethod def cm (cls) : print( "class method, cls=" , cls) def m (self) : print( "method, self={0}, i={1}" .format(self, self.i)) @staticmethod def sm () : print( "static method, A=" , A) if __name__ == '__main__' : a = A() a.m() a.cm() a.sm() 结果如下: method , self =<__ main__ . A object at 0 x02A2D190 >, i =1 class method , cls = < class '__ main__ . A '> static method , A = < class '__ main__ . A '> method就跟C++, Java中的成员方法一样,使用也最普遍

Scala函数式编程_function & method

夙愿已清 提交于 2019-12-09 20:03:43
Scala函数式编程_function & method Function 和 Method 传递性上的区别 method——指的是在trait、class、object中以def关键字声明的,它不能被直接传递。 function—— 类型为 ParamsType=>ResultType 的变量,这些变量背后是用 FunctionN 对象来封装的 ,可以被传递。同时,方法也可以转换成函数。 做个测试,如下,启动scala shell, scala> val increase = (x: Int) => x + 1 increase: Int => Int = <function1> scala> val increase = (x: Int) => x + 1 increase: Int => Int = <function1> scala> val add = (x: Int,y: Int) => x + y add: (Int, Int) => Int = <function2> scala> 可以看到, 变量increase(一个匿名函数并赋值给变量),是用 function1 来封装的。其类型为 Int => Int。 如下赋值给变量的匿名函数, scala> val add = (x: Int,y: Int,z: Int) => x + y + z add: (Int,

opencv模板匹配学习记录

≯℡__Kan透↙ 提交于 2019-12-09 19:10:21
位置: D:\opencv\sources\modules\imgproc\src\templmatch.cpp 源码: void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result, int method, InputArray _mask ) { CV_INSTRUMENT_REGION() if (!_mask.empty()) { cv::matchTemplateMask(_img, _templ, _result, method, _mask); return; } int type = _img.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert( CV_TM_SQDIFF <= method && method <= CV_TM_CCOEFF_NORMED ); CV_Assert( (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims() <= 2 ); bool needswap = _img.size().height < _templ.size().height || _img.size

Java的Method

隐身守侯 提交于 2019-12-09 18:41:14
1.传入一个List对象,即该对象的属性名获取该List中所有该属性的值(属性类型为String) private static List<String> getWybsListValueByName(String fieldName, List list) { try { List<String>lists=new ArrayList<>(list.size()); for (Object object:list) { String firstCode = fieldName.substring(0, 1).toUpperCase(); String getter = "get" + firstCode + fieldName.substring(1); Method method = object.getClass().getMethod(getter); Object value = method.invoke(object); lists.add(value.toString()); } return lists; } catch (Exception e) { return null; } } 来源: https://www.cnblogs.com/notably/p/12012715.html