mybatis中 mapper.xml文件中,获取集合中指定的位置的数据

怎么获取mybatis中 mapper.xml文件中,集合中指定的位置的数据?

2个回答

把问题贴出来 看看 这样没太明白

foreach遍历这种?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
映射语句集合UserMapper.insertUser已经包含值

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for UserMapper.insertUser ### The error may exist in com/lq/bean/User.xml ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for UserMapper.insertUser org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) root cause org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for UserMapper.insertUser ### The error may exist in com/lq/bean/User.xml ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for UserMapper.insertUser org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346) $Proxy5.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:154) com.lq.dao.LoginDao.valiadateUser(LoginDao.java:35) com.lq.service.LoginService.validateUser(LoginService.java:23) com.lq.mvc.ControllerTest.dovalidateUser(ControllerTest.java:39) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

mybatis中对于子查询列的排序问题

我在mysql中直接写语句: SELECT bgb.goods_num, bgb.goods_type_icon, bgb.goods_id, bgb.goods_name, bgb.goods_sort, bgt.type_name, bgs.style_name, bgbr.brand_name, bgb.goods_code, bgb.is_shelf, (select sum(sku_sale_count) from busi_goods_sku AS bgsku WHERE bgb.goods_id=bgsku.goods_id) as sale_count FROM busi_goods_base AS bgb LEFT JOIN busi_goods_type AS bgt ON bgb.goods_type_id=bgt.type_id LEFT JOIN busi_goods_style AS bgs ON bgb.goods_style_id=bgs.style_id LEFT JOIN busi_goods_brand as bgbr ON bgb.goods_brand_id=bgbr.brand_id WHERE bgb.is_del=0 ORDER BY sale_count DESC 是 可以进行查询的,但是把它放到mybatis的mapper.xml中,运行的时候会报错 ![图片说明](https://img-ask.csdn.net/upload/201712/18/1513585576_407575.png)

mybatis中xml遇到 传入多个参数怎么办

这个是我的实体类 ``` public class User { private int id;//编号 private String name;//姓名 private String age;//年龄 private String sex;//性别 private String height;//身高 private String weight;//体重 private String address;//家庭住址 } ``` 这个是我的Mapper接口 ``` /** * 根据条件查询用户 * @param column 要查询的列名 * @param Where 查询条件 * @return 查询到的集合类 */ public List<User> selsctByWhere(String column,String Where); ``` 这个是xml对应要写的《SQL语句和传参,形参》 ``` <!-- 根据条件查询用户************************** --> <select id="selsctByWhere" > </select> ``` 有没有java大神,求解答

springMVC整合报错,求大神帮帮忙,两天了试了好多方法,还是摆不平

_ 2017-11-14 15:32:29,157 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed_ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-beans.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [BloggerMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5105) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1413) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1377) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1613) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1172) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1394) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1398) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1366) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [BloggerMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:522) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:381) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ... 25 more Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:520) ... 28 more Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:837) at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:809) at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:591) at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214) at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ... 30 more springMVC整合报错,求大神帮帮忙,两天了试了好多方法,还是摆不平 spring-bean.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"> <!-- 开启包扫描 --> <context:component-scan base-package="ssm.blog"/> <!-- 配置druid数据源 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="username" value="root"/> <property name="password" value="admin"/> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/db_blog"/> </bean> <!-- 配置mybatis的sqlSessionFactory --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!-- 自动扫描mapper.xml文件--> <property name="mapperLocations" value="classpath:BloggerMapper.xml"/> <!-- 载入mybatis全局配置文件--> <property name="configLocation" value="classpath:mybatis-conf.xml"/> </bean> <!-- 配置mybatis dao接口扫描--> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="ssm.blog.dao"/> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <!-- <property name="javax.persistence.validation.mode"></property>--> </bean> <!-- 配置spring的声明式事务,名字为默认值 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 开启事务控制的注解支持 --> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>

关于mybatis中懒加载的中问题,拜托各位大神了,我检查了好几遍

这个是maper配置: <resultMap type="tableMany" id="manyMap"> <id column="m_id" property="m_id" /> <result column="m_name" property="m_name" /> <collection property="oneList" javaType="tableOne" select="findLazyOne" column="m_id" > </collection> </resultMap> <select id="findMany" resultMap="manyMap" > select * from table_many </select> <select id="findLazyOne" parameterType="java.lang.String" resultType="tableOne" > select * from table_one t where t.m_id=#{value} </select> 这个是调用方法: static TableManyMapper mapper=null; public static void main(String[] args) throws Exception { String resource="mybatis.xml"; InputStream input=Resources.getResourceAsStream(resource); SqlSessionFactory factory=new SqlSessionFactoryBuilder().build(input); SqlSession sqlSession = factory.openSession(); mapper=sqlSession.getMapper(TableManyMapper.class); findMany(); sqlSession.commit(); } public static void findMany(){ List<TableMany> list= mapper.findMany(); for (TableMany tableMany : list) { System.out.println(tableMany.getM_id()+"::"+tableMany.getM_name()); System.out.println("......."); List<TableOne> oneList=tableMany.getOneList(); for (TableOne tableOne : oneList) { System.out.println(tableOne.getO_id()+"::"+tableOne.getO_name()); } } } 这个是报错: 32acceba-7d07-11e7-acb7-14dda920ec0e::多的一方1 ....... Exception in thread "main" org.apache.ibatis.executor.ExecutorException: Statement returned more than one row, where no more than one was expected. at org.apache.ibatis.executor.ResultExtractor.extractObjectFromList(ResultExtractor.java:50) at org.apache.ibatis.executor.loader.ResultLoader.loadResult(ResultLoader.java:71) at org.apache.ibatis.executor.loader.ResultLoaderMap$LoadPair.load(ResultLoaderMap.java:207) at org.apache.ibatis.executor.loader.ResultLoaderMap$LoadPair.load(ResultLoaderMap.java:172) at org.apache.ibatis.executor.loader.ResultLoaderMap.load(ResultLoaderMap.java:80) at org.apache.ibatis.executor.loader.cglib.CglibProxyFactory$EnhancedResultObjectProxyImpl.intercept(CglibProxyFactory.java:147) at com.mybatis.pojo.TableMany$$EnhancerByCGLIB$$49d2b6d7.getOneList(<generated>) at com.mybatis.test.ManayToOne.findMany(ManayToOne.java:62) at com.mybatis.test.ManayToOne.main(ManayToOne.java:28)

mybatis spring 整合 junit测试。 事务不起作用,不提交。删除无效???

applicationContext.xml 中的数据库和 sessionFactory以及事务配置 Xml代码 <bean id="bssDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <!-- Connection Info --> <property name="driverClassName" value="${bss.jdbc.driver}" /> <property name="url" value="${bss.jdbc.url}" /> <property name="username" value="${bss.jdbc.username}" /> <property name="password" value="${bss.jdbc.password}" /> <!-- Connection Pooling Info --> <property name="maxActive" value="${bss.dbcp.maxActive}" /> <property name="maxIdle" value="${bss.dbcp.maxIdle}" /> <property name="defaultAutoCommit" value="false" /> <!-- 连接Idle一个小时后超时 --> <property name="timeBetweenEvictionRunsMillis" value="3600000" /> <property name="minEvictableIdleTimeMillis" value="3600000" /> <property name="testOnBorrow" value="true" /> <property name="testWhileIdle" value="true" /> <property name="validationQuery" value="${bss.dbcp.validationQuery}" /> </bean> <!-- MyBatis配置 --> <bean id="bssSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="bssDataSource" /> <!-- 自动扫描entity目录, 省掉Configuration.xml里的手工配置 别名 --> <property name="typeAliasesPackage" value="com.jxnc56.bss.entity" /> <!-- 显式指定Mapper文件位置 --> <property name="mapperLocations" > <list> <value> classpath:config/mybatis/sqlmap/bss/**/*.xml </value> </list> </property> </bean> <!-- 扫描basePackage下所有以@MyBatisRepository标识的 接口--> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.jxnc56.bss" /> <property name="annotationClass" value="com.jxnc56.bss.dao.MyBatisRepository"/> </bean> <!-- 事务管理,@Transactional("tmBss") --> <bean id="tmBss" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="bssDataSource"></property> <qualifier type="org.springframework.beans.factory.annotation.Qualifier" value="tmBss" /> </bean> <!-- 使用annotation定义数据库事务,这样可以在类或方法中直接使用@Transactional注解来声明事务 --> <tx:annotation-driven transaction-manager="tmBss" proxy-target-class="true" /> java TEST: Java代码 @Transactional("tmBss") public class ProductServiceTest extends SpringTransactionalTestCase { @Autowired private ProductDao pDao; @Test public void deleteTest (){ pDao.delete(4); Product product = new Product(); product.setId(4); System.out.println("-------------------------------------------->"+Arrays.toString(pDao.select(product).toArray())); } } 其中ProductDao 是被@MyBatisRepository标示的接口 log: 2013-06-07 09:40:57 107 - org.mybatis.spring.transaction.SpringManagedTransaction -915 [main] DEBUG org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [jdbc:mysql://localhost/nrcompany?useUnicode=true&characterEncoding=utf-8, UserName=root@localhost, MySQL-AB JDBC Driver] will be managed by Spring 2013-06-07 09:40:57 110 - com.jxnc56.bss.dao.ProductDao.delete -918 [main] DEBUG com.jxnc56.bss.dao.ProductDao.delete - ooo Using Connection [jdbc:mysql://localhost/nrcompany?useUnicode=true&characterEncoding=utf-8, UserName=root@localhost, MySQL-AB JDBC Driver] 2013-06-07 09:40:57 115 - com.jxnc56.bss.dao.ProductDao.delete -923 [main] DEBUG com.jxnc56.bss.dao.ProductDao.delete - ==> Preparing: delete from product where id=? 2013-06-07 09:40:57 140 - com.jxnc56.bss.dao.ProductDao.delete -948 [main] DEBUG com.jxnc56.bss.dao.ProductDao.delete - ==> Parameters: 4(Integer) 2013-06-07 09:40:57 142 - org.mybatis.spring.SqlSessionUtils -950 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3a9d95] 2013-06-07 09:40:57 142 - org.mybatis.spring.SqlSessionUtils -950 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3a9d95] from current transaction

MyBatis if 标签 怎么判断 属性的 属性 是否为空

比如 <if test"type.typeName!=null and type.typeName!=''"> 会报错 但是 sql语句里 使用 #{type.typeName} 一切正常 怎么回事 是不支持吗??? 如何判断

sql语句in的用法,在mybatis中sql中in是怎么用的

SELECT a.smid,a.smx,a.smy,a.NAME FROM BusPoint a , BusPointline b WHERE a.StopID = b.BusPointID AND a.smid in (133,132); 在mybatis框架中,上面的sql语句如何编写? 在mybatis框架中,sql中in是怎么用的? 那位大神知道~~~

mybatis 遍历 List<Map>

一个javaBean就是一个Map<String,Object> map 格式如下 Long cashVoucherId = (Long) voucherMap.get("id"); BigDecimal denomination = (BigDecimal) voucherMap.get("denomination"); 我想批量添加。一个 List<Map<String,Object> > list 那么如何在Mapper.xml遍历呢?跪求大神解决,不胜感谢!

Java MyBatis 如果方法返回的是集合 MyBatis是如何确定是List还是Set的?

java public List<User> findAll(); public Set<User> findAllSet(); mapper映射文件 (1) select id="findAll" resultType="User" select * from user /select (2) select id="findAllSet" resultType="User" select * from user /select 然后我在程序里加了输出类型 第一个返回的是java.util.ArrayList 第二个返回的是java.util.HashSet 我想问MyBatis是怎么知道应该返回List还是Set的,像Hibernate至少还有list,set标签,Query有个list()方法,MyBatis总不至于通过反射接口然后hardcode类型去判断吧

mybatis 进行批量修改操作

批量修改时候传入多个数值不想在service层 进行循环修改, 想在写sql语句的时候进行批量修改 传入的有全部的id和需要修改的数据。怎么写sql语句。。。 只会删除的时候传入id的语句,,现在多个参数不会写了。。

参数list对象结果如何使用mybatis批量插入数据

使用mybatis oracle,当传来的参数是list对象结果集,如何批量插入数据

请问各位大佬,在用spring和mybatis整合时出现如下问题是什么原因?感谢!

init方法调用失败;嵌套异常是org.springframe .core。配置资源:类路径资源[conf.xml];嵌套异常是org.apache.ibatis.builder。BuilderException:解析SQL Mapper配置出错。原因:org.apache.ibatis.builder。BuilderException:错误解析映射器XML。XML位置是'com/lock/mapper/peopleMapper.xml'。原因:org.apache.ibatis.builder。BuilderException:错误解析类。原因:org.apache.ibatis.type。类型异常:无法解析类型别名“People”。原因:. lang。ClassNotFoundException:找不到class: People

关于mybatis延迟加载的问题

我做了一个mybatis的demo里面有两个类:user address,user中存放着一个address,而在数据库中user表中有一个addressid的字段,用于关联address表。 public class User { private int id; private String name; private String password; private int age; private Address address; //get set方法 } public class Address { private int addid; private String addname; private int zipcode; //get set方法 } mybatis配置文件 <configuration> <!-- 延迟加载设置 --> <settings> <setting name="lazyLoadingEnabled" value="true"/> </settings> <!-- 别名 --> <typeAliases> <typeAlias type="com.qshun.model.User" alias="user"/> <typeAlias type="com.qshun.model.Address" alias="address"/> </typeAliases> <!-- 环境参数(数据库连接) --> <environments default="development"> <environment id="development"> <transactionManager type="JDBC" /> <dataSource type="POOLED"> <property name="driver" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost/ibatis" /> <property name="username" value="root" /> <property name="password" value="root" /> </dataSource> </environment> </environments> <!-- 映射文件 --> <mappers> <mapper resource="com/qshun/model/AddressMapper.xml"/> <mapper resource="com/qshun/model/UserMapper.xml"/> </mappers> </configuration> usermapper的实体映射文件 <mapper namespace="com.qshun.mapper.UserMapper"> <resultMap type="user" id="UserResultMap"> <result property="id" column="uid" /> <result property="name" column="uname" /> <result property="password" column="upassword" /> <result property="age" column="uage" /> <association property="address" column="addressid" select="getAddressById" resultMap="AddressResultMap"> </association> </resultMap> <resultMap id="AddressResultMap" type="address"> <result property="addid" column="id"/> <result property="addname" column="addressname"/> <result property="zipcode" column="zipcode"/> </resultMap> <select id="getUserById" resultMap="UserResultMap" parameterType="int"> select uid,uname,upassword,uage,addressid from user where uid=#{id} </select> <select id="getAddressById" resultMap="AddressResultMap"> select addid, addname, zipcode from addr where addid =#{addressid} </select> </mapper> 测试类 private static SqlSession session = null; private static SqlSessionFactory sqlSessionFactory = null; static { try { Reader reader = Resources.getResourceAsReader("MybatisConfig.xml"); sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader); session = sqlSessionFactory.openSession(true); reader.close(); } catch (IOException e) { throw new RuntimeException("=========" + e, e); } } public static void main(String[] args) { UserMapper mapper=session.getMapper(UserMapper.class); User u=mapper.getUserById(1);//理论上讲在执行此操作的时候,不会将address对象查询出来 System.out.println(u.getName()); System.out.println("================"); System.out.println(u.getAddress().getAddname());//此时address才会被执行查询 //但是事实上在执行mapper.getUserById(1)的时候,就执行了address对象的查询,延迟加载没有起效 session.close(); } 另附建表语句 CREATE TABLE `ibatis`.`add` ( `addid` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `addname` VARCHAR(45), `zipcode` VARCHAR(45), PRIMARY KEY (`addid`) ) ENGINE = InnoDB; CREATE TABLE `ibatis`.`user` ( `uid` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `uname` VARCHAR(45), `upassword` VARCHAR(45), `uage` VARCHAR(45), `addressid` VARCHAR(45), PRIMARY KEY (`uid`) ) ENGINE = InnoDB; 请各位牛人,帮忙解答一下,不胜感激 :D

mybatis一对多关联查询问题

org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'roles' in 'class com.jsp.system.user.bo.User' at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:380) at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:170) at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:152) at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:48) at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:116) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.instantiateCollectionPropertyIfAppropriate(DefaultResultSetHandler.java:451) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyNestedResultMappings(DefaultResultSetHandler.java:800) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:758) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForNestedResultMap(DefaultResultSetHandler.java:724) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:267) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:239) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:153) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:60) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:60) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> user.xml配置 <mapper namespace="User"> <resultMap id="UserMap" type="User"> <id property="user_id" column="user_id"/> <result property="userName" column="userName" /> <result property="password" column="password" /> <result property="age" column="age" /> <!-- 一对多的关系 --> <!-- property: 指的是集合属性的值, ofType:指的是集合中元素的类型 --> <collection property="roles" javaType="list" ofType="Role"> <id property="role_id" column="role_id"/> <result property="role_name" column="role_name"/> <result property="role_code" column="role_code"/> </collection> </resultMap> <!-- 按照用户ID查找角色信息 --> <select id="selectUserRole" parameterType="String" resultMap="UserMap"> select u.userName,r.role_name,r.role_name from s_user u,s_role r, s_relate g where u.user_id=g.user_id and r.role_id=g.role_id and u.user_id=#{user_id} </select> </mapper> 报错了,找了半天不知道什么原因. 麻烦大神帮看下,或留个联系方式.

mybatis中级联查询后如何处理两个表的相同字段

**mybatis中级联查询后如何处理两个表的相同字段** 现在出来了一个问题:我级联查询出来后,放置一个在Dept中,发现其中List中的employee对象中的status它直接是Dept的内容,并没有去找自己的内容。 部门: ```java public class Dept { private Integer id ; private String name ; private String address ; private String status ; private List<Employee> employees ; ``` 员工: ``` public class Employee { private int id ; private String name; private String address ; private String status ; ``` 级联映射表: ```xml <resultMap type="Dept" id="resultDeptMap"> <result property="id" column="d_id" /> <result property="name" column="d_name" /> <result property="address" column="d_address" /> <result property="status" column="status" /> <!-- 一对多 List 列表 collection:对关联查询到的多条记录映射到集合中 --> <collection property="employees" ofType="com.wm.mybatis.POJO.Employee" column="d_id" > <id property="id" column="e_id" javaType="int" jdbcType="INTEGER"/> <result property="name" column="e_name" javaType="string" jdbcType="VARCHAR"/> <result property="address" column="e_address" javaType="string" jdbcType="VARCHAR"/> <result property="d_id" column="d_id" javaType="int" jdbcType="INTEGER"/> <result property="status" column="status" /> </collection> </resultMap> ``` 查询出来的结果:List<Employee>中Employee的status状态都是Dept的status,它没有对应到自己的状态位去。 请问大神们,怎么解决??有遇到过的没呢?

mybatis能否返回一个map?

mybatis能否返回一个map? 详细规则如下: 从数据库取出很多数据,每一个数据有id和path两个字段,将id设为key,path 设为value。 我现在只能先构造一个实体类包含id和path,然后,再代码转成map

Spring如何管理泛型bean

<bean id="userMapper" class="org.mybatis.spring.mapper.MapperFactoryBean<T>"> 配置如上。直接这样写可以吗?

mybatis在使用foreach进行List集合查询时,出现sql映射很多问号,不是乱码,就是多了很多问号

近日,在编写Spring Mvc的时候,出现一个特别怪的事情,我正常使用 <select id="findListWithIdsString" resultType="OrderProduct" parameterType="java.util.List"> SELECT <include refid="orderProductOwnColumns"/> a.del_flag AS "delFlag" FROM tbl_order_product a <where> a.del_flag = '0' AND a.id in ('XXXXX','XXXX') </where> </select> 这个是没问题的,但是,当我改为从java传至List的时候,就出问题了,xml代码: <select id="findListWithIdsString" resultType="OrderProduct" parameterType="java.util.List"> SELECT <include refid="orderProductOwnColumns"/> a.del_flag AS "delFlag" FROM tbl_order_product a <where> a.del_flag = '0' <choose> <when test="inComingIds != null and inComingIds.size()>0"> AND a.id in <foreach collection="inComingIds" item="item" index="index" open="(" close=")" separator="," >                  #{item}              </foreach> </when> <otherwise> AND a.id='0' </otherwise> </choose> </where> </select> 然后我的前java端代码是: List<String> idList=new ArrayList<>();//传入的List String opIds=mp.getRelatedOrderProductIds();//前端获取的String Collections.addAll(idList,StringUtils.split(opIds, ","));//转化为List OrderProduct opForSearch=new OrderProduct(); opForSearch.setInComingIds(idList); orderProductService.findListWithIdsString(opForSearch); 数据库配置如下: ?useUnicode=true&characterEncoding=utf-8 出错信息: 2019-05-01 15:28:43,034 DEBUG [modules.sys.dao.OrderProductDao.findListWithIdsString] - ==> Preparing: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) 2019-05-01 15:28:43,034 DEBUG [modules.sys.dao.OrderProductDao.findListWithIdsString] - ==> Parameters: 54eca8e0409a4f5b81919ecbf7b85d44(String), 4fda20df078945aeaae3960f265795c1(String) 2019-05-01 15:28:43,094 ERROR [500.jsp] - ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ### The error may exist in D:\apache-tomcat-8.0.53-ft\webapps\blanink-web\WEB-INF\classes\mappings\modules\sys\OrderProductDao.xml ### The error may involve com.blanink.business.modules.sys.dao.OrderProductDao.findListWithIdsString-Inline ### The error occurred while setting parameters ### SQL: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flalag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ### The error may exist in D:\apache-tomcat-8.0.53-ft\webapps\blanink-web\WEB-INF\classes\mappings\modules\sys\OrderProductDao.xml ### The error may involve com.blanink.business.modules.sys.dao.OrderProductDao.findListWithIdsString-Inline ### The error occurred while setting parameters ### SQL: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flag AS "delFlag", a.del_flag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:399) at com.sun.proxy.$Proxy27.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:205) at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Linux 会成为主流桌面操作系统吗?

整理 |屠敏出品 | CSDN(ID:CSDNnews)2020 年 1 月 14 日,微软正式停止了 Windows 7 系统的扩展支持,这意味着服役十年的 Windows 7,属于...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

学习总结之HTML5剑指前端(建议收藏,图文并茂)

前言学习《HTML5与CSS3权威指南》这本书很不错,学完之后我颇有感触,觉得web的世界开明了许多。这本书是需要有一定基础的web前端开发工程师。这本书主要学习HTML5和css3,看...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

记一次腾讯面试,我挂在了最熟悉不过的队列上……

腾讯后台面试,面试官问:如何自己实现队列?

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

冒泡排序动画(基于python pygame实现)

本项目效果初始截图如下 动画见本人b站投稿:https://www.bilibili.com/video/av95491382 本项目对应github地址:https://github.com/BigShuang python版本:3.6,pygame版本:1.9.3。(python版本一致应该就没什么问题) 样例gif如下 ======================= 大爽歌作,mad

Redis核心原理与应用实践

Redis核心原理与应用实践 在很多场景下都会使用Redis,但是到了深层次的时候就了解的不是那么深刻,以至于在面试的时候经常会遇到卡壳的现象,学习知识要做到系统和深入,不要把Redis想象的过于复杂,和Mysql一样,是个读取数据的软件。 有一个理解是Redis是key value缓存服务器,更多的优点在于对value的操作更加丰富。 安装 yum install redis #yum安装 b...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

立即提问
相关内容推荐