- \ 标记下一个字符是特殊字符或文字。例如,"n" 和字符 "n" 匹配。"\n" 则和换行字符匹配。序列 "\" 和 "" 匹配,而 "(" 则和 "(" 匹配。
- ^ 匹配输入的开头。
- $ 匹配输入的末尾。
-
- 匹配前一个字符零或多次。例如,"zo*" 与 "z" 或 "zoo" 匹配。
-
- 匹配前一个字符一次或多次。例如,"zo+" 与 "zoo" 匹配,但和 "z" 不匹配。
- ? 匹配前一个字符零或一次。例如,"a?ve?" 和 "never" 中的 "ve" 匹配。
- . 匹配除换行字符外的任何单个字符。
- (pattern) 匹配 pattern 并记住该匹配。匹配上的子字符串,要匹配圆括号字符 ( ),则需使用 "(" 或 ")"。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- a 表存在, | |
insert into a select * from bTable | |
-- a 表不存在。并且复制b表表结构(包括字段备注) | |
create table a as select * from bTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 多表更新 不能使用 limit, order by | |
update a inner join b on a.col3=b.col3 | |
Set a.col1=b.col1,a.col2=b.col2 | |
Where 。。。。。 | |
-- 多表删除可以使用select 中所有类型的联合,也可以使用 left join ,或者inner join,或者right join | |
DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id; | |
或: | |
DELETE FROM t1, t2 USING t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 多表更新 不能使用 limit, order by | |
update a inner join b on a.col3=b.col3 | |
Set a.col1=b.col1,a.col2=b.col2 | |
Where 。。。。。 | |
-- 多表删除可以使用select 中所有类型的联合,也可以使用 left join ,或者inner join,或者right join | |
DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id; | |
或: | |
DELETE FROM t1, t2 USING t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem --- set java home and maven home,devenvdir 可以根据实际情况改动 --- | |
set devenvdir=S:\springToolSuite | |
wmic ENVIRONMENT where "name='JAVA_HOME'" delete | |
wmic ENVIRONMENT where "name='MVN_HOME'" delete | |
wmic ENVIRONMENT create name="JAVA_HOME",username="<system>",VariableValue="%devenvdir%\jdk" | |
wmic ENVIRONMENT create name="MVN_HOME",username="<system>",VariableValue="%devenvdir%\apache-maven-3.0.4" | |
rem --- set classpath and path --- |
闲来无事看看《effective java 2》书,里面很多条例记录几个自己比较有益的内容
-
避免不必要的对象生成。尽量复用。优先考虑基础类型
-
消除过期对象引用,防止内存泄漏。可以参考weekHashMap
-
覆盖equals必须满足:1.自反性,2.一致,3.传递性,4.对称,5.非空
-
覆盖equals时必须覆盖hashCode。 相同对象必须拥有相同散列码
-
尽量覆盖toString(),提供debug展示信息
-
compareTo 覆盖注意自反性,传递性,对称性。最后尽量让compareTo==equals
-
检查方法参数的有效性