通过annotation(注解)来映射hibernate实体的,基于annotation的hibernate主键标识为@Id, 其生成规则由@GeneratedValue设定的.这里的@id和@GeneratedValue都是JPA的标准用法。 JPA提供的四种标准用法为TABLE,SEQUENCE ...
分类:
其他好文 时间:
2020-02-23 11:37:47
阅读次数:
79
一、对数据行的增删改查 增:insert into tableName () values(),() 可以一次插入多条或者一条,前面可以指定插入的字段,不指定的话默认为建表时的顺序 删:delete from tableName where.... 改:update tableName set 字段 ...
分类:
数据库 时间:
2020-02-23 11:24:51
阅读次数:
77
ref : "How do I enable UBIFS?" How do I enable UBIFS? Since UBIFS works on top of UBI, you have to enable UBI first (see "here" ). Then in the Linux c ...
分类:
其他好文 时间:
2020-02-22 11:45:50
阅读次数:
76
1 """ 2 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which giv ...
分类:
其他好文 时间:
2020-02-20 13:06:07
阅读次数:
65
Create 语句 Create database语句 ? 语句是在MySQL实例上创建一个指定名的数据库, 语句的语义和 是一样的。先来看下create的语法: 当创建的数据库本身存在而且没有写明 子句时,则创建数据库的语句会报错,实例如下: create_specification子句指明创建的 ...
分类:
数据库 时间:
2020-02-19 23:46:23
阅读次数:
127
想插入数据库一条记录,如果这条记录的主键或者Unique键已存在,则更新这条记录,如果主键或Unique键不存在,则新增这条记录。用Mybatis实现。网上有些方法说用replace into,但是mybatis是不支持的。所以,必须使用ON DUPLICATE KEY UPDATE。 <inser ...
分类:
其他好文 时间:
2020-02-19 13:25:19
阅读次数:
144
create [unique] index index_name on table_name(column_name[,columnname2...]) tablespace tab_space;--创建索引 select * from all_indexs;--获取所有索引信息 ...
分类:
数据库 时间:
2020-02-18 20:55:28
阅读次数:
93
如何选择合适的列建立索引1.在where从句,group by从句,order by从句,on从句中出现的列2.索引字段越小越好3.离散度大的列放到联合索引的前面1select * from payment where staff_id = 2 and customer_id = 584;由于cus... ...
分类:
数据库 时间:
2020-02-18 16:45:06
阅读次数:
74
一、题目说明 题目62. Unique Paths,在一个m n矩阵中,求从左上角Start到右下角Finish所有路径。其中每次只能向下、向右移动。难度是Medium! 二、我的解答 这个题目读读题目,理解后不难。定义一个 ,初始化最后一列为1,最后一行为1,然后循环计算到 就可以了。 代码如下: ...
分类:
其他好文 时间:
2020-02-18 09:36:51
阅读次数:
62
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p ...
分类:
其他好文 时间:
2020-02-17 22:33:36
阅读次数:
99