- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 mysql树形结构表设计(Path Enumerations,Closure Table)
一般比较普遍的就是四种方法:(具体见 SQL Anti-patterns这本书)Adjacency List:每一条记录存parent_idPath Enumerations:每一条记录存整个tree path经过的node枚举Nested Sets:每一条记录存 nleft 和 nrightClosure Table:维护一个表,所有的tree path作为记录进行保存。
2017-05-28 22:57:10 15671 4
原创 angular2 组件之间通过service互相传递
母组件传值给子组件母组件通过service传值给子组件,很简单,声明一个service@Injectable()export class ToolbarTitleService { title:string;}然后在母组件中依赖注入@Component({ selector: 'admin', templateUrl: './admin.component.html',
2017-05-20 11:34:04 6013 1
原创 mybatis 返回主键一直为1
1是返回的插入成功的行数,这没有错而自增id则是直接映射到对象里,直接输出 xxx.getId()即可举例: 在xml中:<insert id="addUser" parameterType="blog.model.User" useGeneratedKeys="true" keyProperty="id">......java中代码:int primary = userService.addU
2017-05-17 21:09:36 5812 8
原创 Angular错误以及注意点
No ‘Access-Control-Allow-Origin’ header is present on the requested resourceweb服务为本地服务时,需要在后台添加headerhttpServletResponse.setHeader("Access-Control-Allow-Origin", "*");
2017-05-04 17:44:23 592
原创 mysql查询练习
mysql删除重复记录,保存Id最小的一条delete from student where id not in (select minid from (select min(id) as minid from student group by name) b);
2017-04-29 21:09:24 384
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人