锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产AV无码专区亚洲AV琪琪,亚洲精品无码久久千人斩,亚洲中文字幕久久精品无码2021http://www.tkk7.com/17learning/鎴戠殑鍗氬錛歨ttp://blog.sina.com.cn/17learningzh-cnFri, 09 May 2025 14:21:42 GMTFri, 09 May 2025 14:21:42 GMT60閫掑綊鏋勫緩鏍?/title><link>http://www.tkk7.com/17learning/archive/2020/09/07/435656.html</link><dc:creator>綆″厛椋?/dc:creator><author>綆″厛椋?/author><pubDate>Mon, 07 Sep 2020 01:56:00 GMT</pubDate><guid>http://www.tkk7.com/17learning/archive/2020/09/07/435656.html</guid><wfw:comment>http://www.tkk7.com/17learning/comments/435656.html</wfw:comment><comments>http://www.tkk7.com/17learning/archive/2020/09/07/435656.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/17learning/comments/commentRss/435656.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/17learning/services/trackbacks/435656.html</trackback:ping><description><![CDATA[<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Consolas';font-size:10.5pt;"><span style="color:#808080;"><br /></span><pre style="font-family: Consolas; font-size: 10.5pt;">createTree(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span>orgNodeTree<span style="color:#cc7832;">, </span>sameOrgNodes<span style="color:#cc7832;">, </span><span style="color:#6897bb;">0</span>)<span style="color:#cc7832;">;</span></pre><span style="color:#808080;"><br /><br /></span><pre style="font-family: Consolas; font-size: 10.5pt;"><span style="color:#bbb529;">@NoArgsConstructor<br /></span><span style="color:#bbb529;">@AllArgsConstructor<br /></span><span style="color:#bbb529;">@Getter<br /></span><span style="color:#bbb529;">@Setter<br /></span><span style="color:#cc7832;">public class </span>NodeTree {<br /> <span style="color:#cc7832;">private </span>String <span style="color:#9876aa;">pName</span><span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> private </span>String <span style="color:#9876aa;">name</span><span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> private int </span><span style="color:#9876aa;">level</span><span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> private </span>List<NodeTree> <span style="color:#9876aa;">children</span><span style="color:#cc7832;">;<br /></span>}</pre><span style="color: #808080;"><br />private void createTree(int leave, int ind, Map<String, NodeTree> pIndexNodeNameMap, List<NodeVo> childNodes) {<br /></span><span style="color:#808080;"> Map<String, NodeTree> cIndexNodeNameMap = new HashMap();<br /></span><span style="color:#808080;"> //</span><span style="color:#808080;font-family:'Arial Unicode MS';">鏋勫緩鏍?/span><span style="color:#808080;"><br /></span><span style="color:#808080;"> int treeNo = pIndexNodeNameMap.size();<br /></span><span style="color:#808080;"> if (treeNo == 0) {<br /></span><span style="color:#808080;"> return;<br /></span><span style="color:#808080;"> }<br /></span><span style="color:#808080;"> int group = 0;<br /></span><span style="color:#808080;"> for (int i = ind; i < childNodes.size(); i++) {<br /></span><span style="color:#808080;"> NodeVo node = childNodes.get(i);<br /></span><span style="color:#808080;"> long index = node.getId() % treeNo;<br /></span><span style="color:#808080;"> NodeTree pNode = pIndexNodeNameMap.get(index + "");<br /></span><span style="color:#808080;"> List<NodeTree> children = pNode.getChildren();<br /></span><span style="color:#808080;"> if (CollectionUtils.isEmpty(children)) {<br /></span><span style="color:#808080;"> children = new ArrayList();<br /></span><span style="color:#808080;"> }<br /></span><span style="color:#808080;"> if (children.size() > 2) {<br /></span><span style="color:#808080;"> leave++;<br /></span><span style="color:#808080;"> createTree(leave, i, cIndexNodeNameMap, childNodes);<br /></span><span style="color:#808080;"> break;<br /></span><span style="color:#808080;"> } else {<br /></span><span style="color:#808080;"> NodeTree child = new NodeTree();<br /></span><span style="color:#808080;"> child.setLevel(leave);<br /></span><span style="color:#808080;"> child.setPName(pNode.getName());<br /></span><span style="color:#808080;"> child.setName(node.getNodeName());<br /></span><span style="color:#808080;"> children.add(child);<br /></span><span style="color:#808080;"> pNode.setChildren(children);<br /></span><span style="color:#808080;"> cIndexNodeNameMap.put(group + "", child);<br /></span><span style="color:#808080;"> group++;<br /></span><span style="color:#808080;"> }<br /></span><span style="color:#808080;"> }<br /></span><span style="color:#808080;"> }<br /><br /><br /></span><pre style="font-family: Consolas; font-size: 10.5pt;"><span style="color:#cc7832;">private boolean </span><span style="color:#ffc66d;">createTree</span>(<span style="color:#cc7832;">int </span>level<span style="color:#cc7832;">, </span>List<NodeTree> parentNodes<span style="color:#cc7832;">, </span>List<NodeVo> childNodes<span style="color:#cc7832;">, int </span>beginIndex) {<br /> <span style="color:#808080;">//</span><span style="color:#808080;font-family:'Arial Unicode MS';">鏋勫緩鏍?br /></span><span style="color:#808080;font-family:'Arial Unicode MS';"> </span>List<NodeTree> nextLevelNodes = <span style="color:#cc7832;">new </span>ArrayList<>()<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> for </span>(<span style="color:#cc7832;">int </span>i = beginIndex<span style="color:#cc7832;">; </span>i < childNodes.size()<span style="color:#cc7832;">; </span>i++) {<br /> <span style="color:#cc7832;">int </span>parentCount = <span style="color:#6897bb;">1</span><span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> for </span>(NodeTree pNode : parentNodes) {<br /> List<NodeTree> children = pNode.getChildren()<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> if </span>(CollectionUtils.<span style="font-style:italic;">isEmpty</span>(children)) {<br /> children = <span style="color:#cc7832;">new </span>ArrayList()<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>pNode.setChildren(children)<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>}<br /> <span style="color:#cc7832;">if </span>(children.size() >= <span style="color:#6897bb;">3</span>) {<br /> <span style="color:#cc7832;">if</span>(parentCount >= parentNodes.size()){<br /> <span style="color:#cc7832;">return </span>createTree(++level<span style="color:#cc7832;">, </span>nextLevelNodes<span style="color:#cc7832;">, </span>childNodes<span style="color:#cc7832;">, </span>beginIndex)<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>}<br /> } <span style="color:#cc7832;">else </span>{<br /> <span style="color:#cc7832;">if </span>(beginIndex >= childNodes.size()) {<br /> <span style="color:#cc7832;">return true;<br /></span><span style="color:#cc7832;"> </span>}<br /> NodeTree child = <span style="color:#cc7832;">new </span>NodeTree()<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>child.setLevel(level)<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>child.setPName(pNode.getName())<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>NodeVo node = childNodes.get(beginIndex)<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>child.setName(node.getNodeName())<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>pNode.getChildren().add(child)<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>nextLevelNodes.add(child)<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>beginIndex++<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>}<br /> parentCount++<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> </span>}<br /> }<br /> <span style="color:#cc7832;">return true;<br /></span>}</pre></pre><img src ="http://www.tkk7.com/17learning/aggbug/435656.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/17learning/" target="_blank">綆″厛椋?/a> 2020-09-07 09:56 <a href="http://www.tkk7.com/17learning/archive/2020/09/07/435656.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Push rejected: Push to origin/master was rejectedhttp://www.tkk7.com/17learning/archive/2018/05/20/433224.html綆″厛椋?/dc:creator>綆″厛椋?/author>Sun, 20 May 2018 04:30:00 GMThttp://www.tkk7.com/17learning/archive/2018/05/20/433224.htmlhttp://www.tkk7.com/17learning/comments/433224.htmlhttp://www.tkk7.com/17learning/archive/2018/05/20/433224.html#Feedback0http://www.tkk7.com/17learning/comments/commentRss/433224.htmlhttp://www.tkk7.com/17learning/services/trackbacks/433224.html鎵ц鍛藉悕錛?br />git pull github master --allow-unrelated-histories

鎵ц緇撴灉濡備笅錛?br />
E:\WorkSpace\workspaceJ2ee\abocode\jfaster>git pull github master --allow-unrelated-histories
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3
Unpacking objects: 100% (3/3), done.
From https://github.com/abocode/jfaster
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> github/master
Merge made by the 'recursive' strategy.
 .gitattributes | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 .gitattributes


]]>
Idea Github璁劇疆榪滅▼Remote浠撳簱鏃舵樉紺篴uthentication failed for xxx閿欒http://www.tkk7.com/17learning/archive/2018/05/20/433223.html綆″厛椋?/dc:creator>綆″厛椋?/author>Sun, 20 May 2018 04:29:00 GMThttp://www.tkk7.com/17learning/archive/2018/05/20/433223.htmlhttp://www.tkk7.com/17learning/comments/433223.htmlhttp://www.tkk7.com/17learning/archive/2018/05/20/433223.html#Feedback0http://www.tkk7.com/17learning/comments/commentRss/433223.htmlhttp://www.tkk7.com/17learning/services/trackbacks/433223.html榪涘叆“鎺у埗闈㈡澘”——“鐢ㄦ埛璐︽埛”-鍑嵁綆$悊鍣?#8212;—windows鍑嵁

鎵懼埌浜唃it鐨勭敤鎴峰悕瀵嗙爜銆備慨鏀規(guī)紜悗ok



]]>
Java鑷畾涔夋敞瑙g畝鍗曞叆闂?/title><link>http://www.tkk7.com/17learning/archive/2016/08/18/431631.html</link><dc:creator>綆″厛椋?/dc:creator><author>綆″厛椋?/author><pubDate>Thu, 18 Aug 2016 12:42:00 GMT</pubDate><guid>http://www.tkk7.com/17learning/archive/2016/08/18/431631.html</guid><wfw:comment>http://www.tkk7.com/17learning/comments/431631.html</wfw:comment><comments>http://www.tkk7.com/17learning/archive/2016/08/18/431631.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/17learning/comments/commentRss/431631.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/17learning/services/trackbacks/431631.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 24px; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">鍏冩敞瑙o細</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 24px; background-color: #ffffff;">銆銆鍏冩敞瑙g殑浣滅敤灝辨槸璐熻矗娉ㄨВ鍏朵粬娉ㄨВ銆侸ava5.0瀹氫箟浜?涓爣鍑嗙殑meta-annotation綾誨瀷錛屽畠浠鐢ㄦ潵鎻愪緵瀵瑰叾瀹?annotation綾誨瀷浣滆鏄庛侸ava5.0瀹氫箟鐨勫厓娉ㄨВ錛?br style="margin: 0px; padding: 0px;" />銆銆銆銆1.@Target,<br style="margin: 0px; padding: 0px;" />銆銆銆銆2.@Retention,<br style="margin: 0px; padding: 0px;" />銆銆銆銆3.@Documented,<br style="margin: 0px; padding: 0px;" />銆銆銆銆4.@Inherited<br style="margin: 0px; padding: 0px;" /></p><span style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 24px; background-color: #ffffff;">銆銆榪欎簺綾誨瀷鍜屽畠浠墍鏀寔鐨勭被鍦╦ava.lang.annotation鍖呬腑鍙互鎵懼埌銆備笅闈㈡垜浠湅涓涓嬫瘡涓厓娉ㄨВ鐨勪綔鐢ㄥ拰鐩稿簲鍒嗗弬鏁扮殑浣跨敤璇存槑銆?/span><br /><strong>浠ヤ笅涓轟竴涓畝鍗曞満鏅殑搴旂敤錛?/strong><br /> 1.瀹氫箟娉ㄨВ錛?br />   <br /><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier New';font-size:9.8pt;"><span style="color:#bbb529;">@Target</span>(<span style="color:#9876aa;font-style:italic;">TYPE</span>)<br /><span style="color:#bbb529;">@Retention</span>(<span style="color:#9876aa;font-style:italic;">RUNTIME</span>)<br /><span style="color:#cc7832;">public </span>@<span style="color:#cc7832;">interface </span><span style="color:#bbb529;">Table </span>{<br /> <span style="color:#629755;font-style:italic;">/**<br /></span><span style="color:#629755;font-style:italic;"> * (Optional) The name of the table.<br /></span><span style="color:#629755;font-style:italic;"> * </span><span style="color:#77b767;font-style:italic;"><p/><br /></span> <span style="color:#629755;font-style:italic;">* Defaults to the entity name.<br /></span><span style="color:#629755;font-style:italic;"> */<br /></span> String <span style="color:#ffc66d;">name</span>() <span style="color:#cc7832;">default </span><span style="color:#6a8759;">""</span><span style="color:#cc7832;">;<br />}<br /></span></pre><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier New';font-size:9.8pt;"><span style="color:#bbb529;">@Target</span>({<span style="color:#9876aa;font-style:italic;">METHOD</span><span style="color:#cc7832;">, </span><span style="color:#9876aa;font-style:italic;">FIELD</span>})<br /><span style="color:#bbb529;">@Retention</span>(<span style="color:#9876aa;font-style:italic;">RUNTIME</span>)<br /><span style="color:#cc7832;">public </span>@<span style="color:#cc7832;">interface </span><span style="color:#bbb529;">Column </span>{<br /><br /> <span style="color:#629755;font-style:italic;">/**<br /></span><span style="color:#629755;font-style:italic;"> * (Optional) The name of the column. Defaults to<br /></span><span style="color:#629755;font-style:italic;"> * the property or field name.<br /></span><span style="color:#629755;font-style:italic;"> */<br /></span> String <span style="color:#ffc66d;">name</span>() <span style="color:#cc7832;">default </span><span style="color:#6a8759;">""</span><span style="color:#cc7832;">;<br />}<br /></span></pre>2銆佸畾涔夊疄浣撶被錛?br />  <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier New';font-size:9.8pt;"><br /><span style="color:#bbb529;">@Table</span>(<span style="color:#d0d0ff;">name </span>= <span style="color:#6a8759;">"t_s_user"</span>)<br /><span style="color:#cc7832;">public class </span>User {<br /> <span style="color:#bbb529;">@Column</span>(<span style="color:#d0d0ff;">name</span>=<span style="color:#6a8759;">"name"</span>)<br /> <span style="color:#cc7832;">private </span>String <span style="color:#9876aa;">name</span><span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"><br /></span> <span style="color:#bbb529;">@Column</span>(<span style="color:#d0d0ff;">name</span>=<span style="color:#6a8759;">"pwd"</span>)<br /> <span style="color:#cc7832;">private </span>String <span style="color:#9876aa;">pwd</span><span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"><br /></span><span style="color:#cc7832;"> public </span>String <span style="color:#ffc66d;">getName</span>() {<br /> <span style="color:#cc7832;">return </span><span style="color:#9876aa;">name</span><span style="color:#cc7832;">;<br /></span> }<br /><br /> <span style="color:#cc7832;">public void </span><span style="color:#ffc66d;">setName</span>(String name) {<br /> <span style="color:#cc7832;">this</span>.<span style="color:#9876aa;">name </span>= name<span style="color:#cc7832;">;<br /></span> }<br /><br /> <span style="color:#cc7832;">public </span>String <span style="color:#ffc66d;">getPwd</span>() {<br /> <span style="color:#cc7832;">return </span><span style="color:#9876aa;">pwd</span><span style="color:#cc7832;">;<br /></span> }<br /><br /> <span style="color:#cc7832;">public void </span><span style="color:#ffc66d;">setPwd</span>(String pwd) {<br /> <span style="color:#cc7832;">this</span>.<span style="color:#9876aa;">pwd </span>= pwd<span style="color:#cc7832;">;<br /></span> }<br />}</pre><br />3銆佽繍琛岋細<br /><br /><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier New';font-size:9.8pt;"><span style="color:#cc7832;">public static void </span><span style="color:#ffc66d;">print</span>() {<br /> System.<span style="color:#9876aa;font-style:italic;">out</span>.println(<span style="color:#6a8759;">"table's name</span><span style="color:#6a8759;font-family:'瀹嬩綋';">錛?/span><span style="color:#6a8759;">" </span>+ User.<span style="color:#cc7832;">class</span>.getAnnotation(<span style="color:#bbb529;">Table</span>.<span style="color:#cc7832;">class</span>).name())<span style="color:#cc7832;">;<br /></span> Field[] fields = User.<span style="color:#cc7832;">class</span>.getDeclaredFields()<span style="color:#cc7832;">;<br /></span><span style="color:#cc7832;"> for </span>(<span style="color:#cc7832;">int </span>i = <span style="color:#6897bb;">0</span><span style="color:#cc7832;">; </span>i < fields.<span style="color:#9876aa;">length</span><span style="color:#cc7832;">; </span>i++) {<br /> Field field = fields[i]<span style="color:#cc7832;">;<br /></span> System.<span style="color:#9876aa;font-style:italic;">out</span>.println(<span style="color:#6a8759;">"field's type:" </span>+ field.getType().getName())<span style="color:#cc7832;">;<br /></span> System.<span style="color:#9876aa;font-style:italic;">out</span>.println(<span style="color:#6a8759;">"field's columnName:" </span>+ field.getAnnotation(<span style="color:#bbb529;">Column</span>.<span style="color:#cc7832;">class</span>).name())<span style="color:#cc7832;">;<br /></span> }<br />}</pre><br />鍏充簬娉ㄨВ鐨勮緇嗕粙緇嶏細http://www.cnblogs.com/peida/archive/2013/04/24/3036689.html<img src ="http://www.tkk7.com/17learning/aggbug/431631.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/17learning/" target="_blank">綆″厛椋?/a> 2016-08-18 20:42 <a href="http://www.tkk7.com/17learning/archive/2016/08/18/431631.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Maven欏圭洰閰嶇疆鏂囦歡涓嶅湪resources涓嬶紝濡備綍浣跨敤idea寮曞叆閰嶇疆鏂囦歡http://www.tkk7.com/17learning/archive/2016/04/29/idea_chooese_classpath.html綆″厛椋?/dc:creator>綆″厛椋?/author>Fri, 29 Apr 2016 07:42:00 GMThttp://www.tkk7.com/17learning/archive/2016/04/29/idea_chooese_classpath.htmlhttp://www.tkk7.com/17learning/comments/430297.htmlhttp://www.tkk7.com/17learning/archive/2016/04/29/idea_chooese_classpath.html#Feedback0http://www.tkk7.com/17learning/comments/commentRss/430297.htmlhttp://www.tkk7.com/17learning/services/trackbacks/430297.html
2.宸︿笂瑙掗夋嫨娣誨姞錛岄夋嫨娣誨姞java錛堣繕鎻愪緵浜嗘坊鍔爉aven欏圭洰錛夛紝鐒跺悗閫夋嫨鎵闇瑕佺殑鐩綍錛?br />
3.idea 浼氭彁紺洪夋嫨娣誨姞浠涔堢被鍨嬬殑鏂囦歡錛屾垜浠槸鍗曠函鐨勬枃浠訛紝鎵浠ラ夋嫨classes

   

 

]]>
nginx 鍙嶅悜浠g悊鍒?serverhttp://www.tkk7.com/17learning/archive/2016/01/19/429116.html綆″厛椋?/dc:creator>綆″厛椋?/author>Tue, 19 Jan 2016 09:46:00 GMThttp://www.tkk7.com/17learning/archive/2016/01/19/429116.htmlhttp://www.tkk7.com/17learning/comments/429116.htmlhttp://www.tkk7.com/17learning/archive/2016/01/19/429116.html#Feedback0http://www.tkk7.com/17learning/comments/commentRss/429116.htmlhttp://www.tkk7.com/17learning/services/trackbacks/429116.htmlnginx 鍙嶅悜浠g悊鍒?apache
server {
        listen       80;
        server_name  app.haeee.com;
index index.html index.htm index.php;
   root /alidata/www/movie-app;
     error_page 404 500 502 503 504 http://app.haeee.com; 
location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#浼潤鎬佽鍒?/div>
#include /alidata/server/nginx/conf/rewrite/phpwind.conf;
access_log  /alidata/log/nginx/access/movie-app.log;
}

nginx 鍙嶅悜浠g悊鍒?tomcat
server {
    listen   80;
    server_name  hulasou.com www.hulasou.com;
index index.html index.htm index.jsp;
#location ~ .*\.(jsp)?$
location /{      
index index.jsp;
        proxy_pass http://localhost:8181;
}
#浼潤鎬佽鍒?span style="white-space: pre;">
include /alidata/server/nginx/conf/rewrite/uuxiaohua.conf;
access_log  /alidata/log/nginx/access/uuxiaohua.log;
}


]]>
Spring boot欏圭洰鎵撴垚war鍖呴儴緗插埌tomcathttp://www.tkk7.com/17learning/archive/2016/01/14/429055.html綆″厛椋?/dc:creator>綆″厛椋?/author>Thu, 14 Jan 2016 09:21:00 GMThttp://www.tkk7.com/17learning/archive/2016/01/14/429055.htmlhttp://www.tkk7.com/17learning/comments/429055.htmlhttp://www.tkk7.com/17learning/archive/2016/01/14/429055.html#Feedback1http://www.tkk7.com/17learning/comments/commentRss/429055.htmlhttp://www.tkk7.com/17learning/services/trackbacks/429055.html
@SpringBootApplication
@ComponentScan
@Import({DBConfiguration.class, ResourceConfiguration.class,AppConfiguration.class})
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
2銆佷慨鏀筽om鏂囦歡錛?br />    淇敼packaging
    <packaging>war</packaging>
  鍔犲叆鎵撳寘鍒皌omcat鐨勯厤緗細
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-legacy</artifactId>
<version>1.0.2.RELEASE</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>

<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>

3銆佸鏋滀笉闇瑕?span style="color: #2f2f2f; font-family: 'lucida grande', 'lucida sans unicode', lucida, helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; font-size: 16px; line-height: 27.2px; text-align: justify; background-color: #ffffff;">JMX鍦╝pplication.properties鏂囦歡涓姞鍏ラ厤緗」錛?br />
endpoints.jmx.uniqueNames=true
鎴栬呯洿鎺ュ叧闂細
 endpoints.jmx.enabled=false


]]>
Spring Data JDBC 璇﹁Вhttp://www.tkk7.com/17learning/archive/2015/12/28/428853.html綆″厛椋?/dc:creator>綆″厛椋?/author>Mon, 28 Dec 2015 15:48:00 GMThttp://www.tkk7.com/17learning/archive/2015/12/28/428853.htmlhttp://www.tkk7.com/17learning/comments/428853.htmlhttp://www.tkk7.com/17learning/archive/2015/12/28/428853.html#Feedback2http://www.tkk7.com/17learning/comments/commentRss/428853.htmlhttp://www.tkk7.com/17learning/services/trackbacks/428853.html

Build Status Maven Central

Spring Data JDBC generic DAO implementation

The purpose of this project is to provide generic, lightweight and easy to use DAO implementation for relational databases based on JdbcTemplate from Spring framework, compatible with Spring Data umbrella of projects.

Design objectives

  • Lightweight, fast and low-overhead. Only a handful of classes, no XML, annotations, reflection
  • This is not full-blown ORM. No relationship handling, lazy loading, dirty checking, caching
  • CRUD implemented in seconds
  • For small applications where JPA is an overkill
  • Use when simplicity is needed or when future migration e.g. to JPA is considered
  • Minimalistic support for database dialect differences (e.g. transparent paging of results)

Features

Each DAO provides built-in support for:

  • Mapping to/from domain objects through RowMapper abstraction
  • Generated and user-defined primary keys
  • Extracting generated key
  • Compound (multi-column) primary keys
  • Immutable domain objects
  • Paging (requesting subset of results)
  • Sorting over several columns (database agnostic)
  • Optional support for many-to-one relationships
  • Supported databases (continuously tested):
    • MySQL
    • PostgreSQL
    • H2
    • HSQLDB
    • Derby
    • MS SQL Server (2008, 2012)
    • Oracle 10g / 11g (9i should work too)
    • ...and most likely many others
  • Easily extendable to other database dialects via SqlGenerator class.
  • Easy retrieval of records by ID

API

Compatible with Spring Data PagingAndSortingRepository abstraction, all these methods are implemented for you:

public interface PagingAndSortingRepository<T, ID extends Serializable> extends CrudRepository<T, ID> {
 T  save(T entity);
Iterable<T> save(Iterable<? extends T> entities);
 T  findOne(ID id);
boolean exists(ID id);
Iterable<T> findAll();
   long count();
   void delete(ID id);
   void delete(T entity);
   void delete(Iterable<? extends T> entities);
   void deleteAll();
Iterable<T> findAll(Sort sort);
Page<T> findAll(Pageable pageable);
Iterable<T> findAll(Iterable<ID> ids);
}

Pageable and Sort parameters are also fully supported, which means you get paging and sorting by arbitrary properties for free. For example say you have userRepository extending PagingAndSortingRepository<User, String> interface (implemented for you by the library) and you request 5th page of USERS table, 10 per page, after applying some sorting:

Page<User> page = userRepository.findAll(
new PageRequest(
5, 10, 
new Sort(
new Order(DESC, "reputation"), 
new Order(ASC, "user_name")
)
)
);

Spring Data JDBC repository library will translate this call into (PostgreSQL syntax):

SELECT *
FROM USERS
ORDER BY reputation DESC, user_name ASC
LIMIT 50 OFFSET 10

...or even (Derby syntax):

SELECT * FROM (
SELECT ROW_NUMBER() OVER () AS ROW_NUM, t.*
FROM (
SELECT * 
FROM USERS 
ORDER BY reputation DESC, user_name ASC
) AS t
) AS a 
WHERE ROW_NUM BETWEEN 51 AND 60

No matter which database you use, you'll get Page<User> object in return (you still have to provide RowMapper<User> yourself to translate from ResultSet to domain object). If you don't know Spring Data project yet, Page<T> is a wonderful abstraction, not only encapsulating List<T>, but also providing metadata such as total number of records, on which page we currently are, etc.

Reasons to use

  • You consider migration to JPA or even some NoSQL database in the future.

    Since your code will rely only on methods defined in PagingAndSortingRepository and CrudRepository from Spring Data Commons umbrella project you are free to switch from JdbcRepository implementation (from this project) to: JpaRepository, MongoRepository, GemfireRepository or GraphRepository. They all implement the same common API. Of course don't expect that switching from JDBC to JPA or MongoDB will be as simple as switching imported JAR dependencies - but at least you minimize the impact by using same DAO API.

  • You need a fast, simple JDBC wrapper library. JPA or even MyBatis is an overkill

  • You want to have full control over generated SQL if needed

  • You want to work with objects, but don't need lazy loading, relationship handling, multi-level caching, dirty checking... You need CRUD and not much more

  • You want to by DRY

  • You are already using Spring or maybe even JdbcTemplate, but still feel like there is too much manual work

  • You have very few database tables

Getting started

For more examples and working code don't forget to examine project tests.

Prerequisites

Maven coordinates:

<dependency>
<groupId>com.nurkiewicz.jdbcrepository</groupId>
<artifactId>jdbcrepository</artifactId>
<version>0.4</version>
</dependency>

This project is available under maven central repository.

Alternatively you can download source code as ZIP.


In order to start your project must have DataSource bean present and transaction management enabled. Here is a minimal MySQL configuration:

@EnableTransactionManagement
@Configuration
public class MinimalConfig {
@Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
@Bean
public DataSource dataSource() {
MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();
ds.setUser("user");
ds.setPassword("secret");
ds.setDatabaseName("db_name");
return ds;
}
}

Entity with auto-generated key

Say you have a following database table with auto-generated key (MySQL syntax):

CREATE TABLE COMMENTS (
id INT AUTO_INCREMENT,
user_name varchar(256),
contents varchar(1000),
created_time TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);

First you need to create domain object User mapping to that table (just like in any other ORM):

public class Comment implements Persistable<Integer> {
private Integer id;
private String userName;
private String contents;
private Date createdTime;
@Override
public Integer getId() {
return id;
}
@Override
public boolean isNew() {
return id == null;
}
//getters/setters/constructors/...
}

Apart from standard Java boilerplate you should notice implementing Persistable<Integer> where Integer is the type of primary key. Persistable<T> is an interface coming from Spring Data project and it's the only requirement we place on your domain object.

Finally we are ready to create our CommentRepository DAO:

@Repository
public class CommentRepository extends JdbcRepository<Comment, Integer> {
public CommentRepository() {
super(ROW_MAPPER, ROW_UNMAPPER, "COMMENTS");
}
public static final RowMapper<Comment> ROW_MAPPER = //see below
private static final RowUnmapper<Comment> ROW_UNMAPPER = //see below
@Override
protected <S extends Comment> S postCreate(S entity, Number generatedId) {
entity.setId(generatedId.intValue());
return entity;
}
}

First of all we use @Repository annotation to mark DAO bean. It enables persistence exception translation. Also such annotated beans are discovered by CLASSPATH scanning.

As you can see we extend JdbcRepository<Comment, Integer> which is the central class of this library, providing implementations of all PagingAndSortingRepository methods. Its constructor has three required dependencies: RowMapper, RowUnmapper and table name. You may also provide ID column name, otherwise default "id" is used.

If you ever used JdbcTemplate from Spring, you should be familiar with RowMapper interface. We need to somehow extract columns from ResultSet into an object. After all we don't want to work with raw JDBC results. It's quite straightforward:

public static final RowMapper<Comment> ROW_MAPPER = new RowMapper<Comment>() {
@Override
public Comment mapRow(ResultSet rs, int rowNum) throws SQLException {
return new Comment(
rs.getInt("id"),
rs.getString("user_name"),
rs.getString("contents"),
rs.getTimestamp("created_time")
);
}
};

RowUnmapper comes from this library and it's essentially the opposite of RowMapper: takes an object and turns it into a Map. This map is later used by the library to construct SQL CREATE/UPDATE queries:

private static final RowUnmapper<Comment> ROW_UNMAPPER = new RowUnmapper<Comment>() {
@Override
public Map<String, Object> mapColumns(Comment comment) {
Map<String, Object> mapping = new LinkedHashMap<String, Object>();
mapping.put("id", comment.getId());
mapping.put("user_name", comment.getUserName());
mapping.put("contents", comment.getContents());
mapping.put("created_time", new java.sql.Timestamp(comment.getCreatedTime().getTime()));
return mapping;
}
};

If you never update your database table (just reading some reference data inserted elsewhere) you may skip RowUnmapper parameter or use MissingRowUnmapper.

Last piece of the puzzle is the postCreate() callback method which is called after an object was inserted. You can use it to retrieve generated primary key and update your domain object (or return new one if your domain objects are immutable). If you don't need it, just don't override postCreate().

Check out JdbcRepositoryGeneratedKeyTest for a working code based on this example.

By now you might have a feeling that, compared to JPA or Hibernate, there is quite a lot of manual work. However various JPA implementations and other ORM frameworks are notoriously known for introducing significant overhead and manifesting some learning curve. This tiny library intentionally leaves some responsibilities to the user in order to avoid complex mappings, reflection, annotations... all the implicitness that is not always desired.

This project is not intending to replace mature and stable ORM frameworks. Instead it tries to fill in a niche between raw JDBC and ORM where simplicity and low overhead are key features.

Entity with manually assigned key

In this example we'll see how entities with user-defined primary keys are handled. Let's start from database model:

CREATE TABLE USERS (
user_name varchar(255),
date_of_birth TIMESTAMP NOT NULL,
enabled BIT(1) NOT NULL,
PRIMARY KEY (user_name)
);

...and User domain model:

public class User implements Persistable<String> {
private transient boolean persisted;
private String userName;
private Date dateOfBirth;
private boolean enabled;
@Override
public String getId() {
return userName;
}
@Override
public boolean isNew() {
return !persisted;
}
public void setPersisted(boolean persisted) {
this.persisted = persisted;
}
//getters/setters/constructors/...
}

Notice that special persisted transient flag was added. Contract of [CrudRepository.save()](http://static.springsource.org/spring-data/data-commons/docs/current/api/org/springframework/data/repository/CrudRepository.html#save(S)) from Spring Data project requires that an entity knows whether it was already saved or not (isNew()) method - there are no separate create() and update() methods. Implementing isNew() is simple for auto-generated keys (see Comment above) but in this case we need an extra transient field. If you hate this workaround and you only insert data and never update, you'll get away with return true all the time from isNew().

And finally our DAO, UserRepository bean:

@Repository
public class UserRepository extends JdbcRepository<User, String> {
public UserRepository() {
super(ROW_MAPPER, ROW_UNMAPPER, "USERS", "user_name");
}
public static final RowMapper<User> ROW_MAPPER = //...
public static final RowUnmapper<User> ROW_UNMAPPER = //...
@Override
protected <S extends User> S postUpdate(S entity) {
entity.setPersisted(true);
return entity;
}
@Override
protected <S extends User> S postCreate(S entity, Number generatedId) {
entity.setPersisted(true);
return entity;
}
}

"USERS" and "user_name" parameters designate table name and primary key column name. I'll leave the details of mapper and unmapper (see source code). But please notice postUpdate() and postCreate() methods. They ensure that once object was persisted, persisted flag is set so that subsequent calls to save() will update existing entity rather than trying to reinsert it.

Check out JdbcRepositoryManualKeyTest for a working code based on this example.

Compound primary key

We also support compound primary keys (primary keys consisting of several columns). Take this table as an example:

CREATE TABLE BOARDING_PASS (
flight_no VARCHAR(8) NOT NULL,
seq_no INT NOT NULL,
passenger VARCHAR(1000),
seat CHAR(3),
PRIMARY KEY (flight_no, seq_no)
);

I would like you to notice the type of primary key in Persistable<T>:

public class BoardingPass implements Persistable<Object[]> {
private transient boolean persisted;
private String flightNo;
private int seqNo;
private String passenger;
private String seat;
@Override
public Object[] getId() {
return pk(flightNo, seqNo);
}
@Override
public boolean isNew() {
return !persisted;
}
//getters/setters/constructors/...
}

Unfortunately library does not support small, immutable value classes encapsulating all ID values in one object (like JPA does with @IdClass), so you have to live with Object[] array. Defining DAO class is similar to what we've already seen:

public class BoardingPassRepository extends JdbcRepository<BoardingPass, Object[]> {
public BoardingPassRepository() {
this("BOARDING_PASS");
}
public BoardingPassRepository(String tableName) {
super(MAPPER, UNMAPPER, new TableDescription(tableName, null, "flight_no", "seq_no")
);
}
public static final RowMapper<BoardingPass> ROW_MAPPER = //...
public static final RowUnmapper<BoardingPass> UNMAPPER = //...
}

Two things to notice: we extend JdbcRepository<BoardingPass, Object[]> and we provide two ID column names just as expected: "flight_no", "seq_no". We query such DAO by providing both flight_no and seq_no (necessarily in that order) values wrapped by Object[]:

BoardingPass pass = boardingPassRepository.findOne(new Object[] {"FOO-1022", 42});

No doubts, this is cumbersome in practice, so we provide tiny helper method which you can statically import:

import static com.nurkiewicz.jdbcrepository.JdbcRepository.pk;
//...
BoardingPass foundFlight = boardingPassRepository.findOne(pk("FOO-1022", 42));

Check out JdbcRepositoryCompoundPkTest for a working code based on this example.

Transactions

This library is completely orthogonal to transaction management. Every method of each repository requires running transaction and it's up to you to set it up. Typically you would place @Transactional on service layer (calling DAO beans). I don't recommend placing @Transactional over every DAO bean.

Caching

Spring Data JDBC repository library is not providing any caching abstraction or support. However adding @Cacheable layer on top of your DAOs or services using caching abstraction in Spring is quite straightforward. See also: @Cacheable overhead in Spring.

Contributions

..are always welcome. Don't hesitate to submit bug reports and pull requests.

Testing

This library is continuously tested using Travis (Build Status). Test suite consists of 60+ distinct tests each run against 8 different databases: MySQL, PostgreSQL, H2, HSQLDB and Derby + MS SQL Server and Oracle tests not run as part of CI.

When filling bug reports or submitting new features please try including supporting test cases. Each pull request is automatically tested on a separate branch.

Building

After forking the official repository building is as simple as running:

$ mvn install

You'll notice plenty of exceptions during JUnit test execution. This is normal. Some of the tests run against MySQL and PostgreSQL available only on Travis CI server. When these database servers are unavailable, whole test is simply skipped:

Results :
Tests run: 484, Failures: 0, Errors: 0, Skipped: 295

Exception stack traces come from root AbstractIntegrationTest.

Design

Library consists of only a handful of classes, highlighted in the diagram below (source):

UML diagram

JdbcRepository is the most important class that implements all PagingAndSortingRepository methods. Each user repository has to extend this class. Also each such repository must at least implement RowMapper and RowUnmapper (only if you want to modify table data).

SQL generation is delegated to SqlGenerator. PostgreSqlGenerator. and DerbySqlGenerator are provided for databases that don't work with standard generator.

Changelog

0.4.1

0.4

  • Repackaged: com.blogspot.nurkiewicz -> com.nurkiewicz

0.3.2

  • First version available in Maven central repository
  • Upgraded Spring Data Commons 1.6.1 -> 1.8.0

0.3.1

0.3

0.2

0.1

License

This project is released under version 2.0 of the Apache License (same as Spring framework).



]]>
IntelliJ IDEA 蹇嵎閿ぇ鍏紝鍙奍DEA甯哥敤閰嶇疆http://www.tkk7.com/17learning/archive/2015/09/26/hulasou.html綆″厛椋?/dc:creator>綆″厛椋?/author>Sat, 26 Sep 2015 03:38:00 GMThttp://www.tkk7.com/17learning/archive/2015/09/26/hulasou.htmlhttp://www.tkk7.com/17learning/comments/427503.htmlhttp://www.tkk7.com/17learning/archive/2015/09/26/hulasou.html#Feedback0http://www.tkk7.com/17learning/comments/commentRss/427503.htmlhttp://www.tkk7.com/17learning/services/trackbacks/427503.htmlIdea鏄洰鍓嶆渶濂界殑寮鍙戝伐鍏鳳紝緇忔敹闆嗗強鏁寸悊濡備笅甯哥敤蹇嵎閿細 
涓銆佸父鐢ㄥ揩鎹烽敭錛?/strong>  

     
  1.甯哥敤鎿嶄綔錛?/strong>
       Ctrl+E錛屽彲浠ユ樉紺烘渶榪戠紪杈戠殑鏂囦歡鍒楄〃
銆銆Shift+Click鍙互鍏抽棴鏂囦歡
銆銆Ctrl+[鎴朷鍙互璺沖埌澶ф嫭鍙風殑寮澶寸粨灝?/div>
銆銆Ctrl+Shift+Backspace鍙互璺寵漿鍒頒笂嬈$紪杈戠殑鍦版柟
銆銆Ctrl+F12錛屽彲浠ユ樉紺哄綋鍓嶆枃浠剁殑緇撴瀯
銆銆Ctrl+F7鍙互鏌ヨ褰撳墠鍏冪礌鍦ㄥ綋鍓嶆枃浠朵腑鐨勫紩鐢紝鐒跺悗鎸塅3鍙互閫夋嫨
銆銆Ctrl+N錛屽彲浠ュ揩閫熸墦寮綾?/div>
銆銆Ctrl+Shift+N錛屽彲浠ュ揩閫熸墦寮鏂囦歡
銆銆Alt+Q鍙互鐪嬪埌褰撳墠鏂規(guī)硶鐨勫0鏄?/div>
銆銆Ctrl+W鍙互閫夋嫨鍗曡瘝緇ц岃鍙ョ戶鑰岃緇ц屽嚱鏁?/div>
銆銆Alt+F1鍙互灝嗘鍦ㄧ紪杈戠殑鍏冪礌鍦ㄥ悇涓潰鏉夸腑瀹氫綅
銆銆Ctrl+P錛屽彲浠ユ樉紺哄弬鏁頒俊鎭?/div>
銆銆Ctrl+Shift+Insert鍙互閫夋嫨鍓創(chuàng)鏉垮唴瀹瑰茍鎻掑叆
銆銆Alt+Insert鍙互鐢熸垚鏋勯犲櫒/Getter/Setter絳?/div>
銆銆Ctrl+Alt+V 鍙互寮曞叆鍙橀噺銆備緥濡傛妸鎷彿鍐呯殑SQL璧嬫垚涓涓彉閲?/div>
銆銆Ctrl+Alt+T鍙互鎶婁唬鐮佸寘鍦ㄤ竴鍧楀唴錛屼緥濡倀ry/catch
銆銆Alt+Up and Alt+Down鍙湪鏂規(guī)硶闂村揩閫熺Щ鍔?/div>
銆銆2. 鏌ヨ蹇嵎閿?/strong>
銆銆CTRL+N 鏌ユ壘綾?/div>
銆銆CTRL+SHIFT+N 鏌ユ壘鏂囦歡
銆銆CTRL+SHIFT+ALT+N 鏌ユ壘綾諱腑鐨勬柟娉曟垨鍙橀噺
銆銆CIRL+B 鎵懼彉閲忕殑鏉ユ簮
銆銆CTRL+ALT+B 鎵炬墍鏈夌殑瀛愮被
銆銆CTRL+SHIFT+B 鎵懼彉閲忕殑綾?/div>
銆銆CTRL+G 瀹氫綅琛?/div>
銆銆CTRL+F 鍦ㄥ綋鍓嶇獥鍙f煡鎵炬枃鏈?/div>
銆銆CTRL+SHIFT+F 鍦ㄦ寚瀹氱獥鍙f煡鎵炬枃鏈?/div>
銆銆CTRL+R 鍦?褰撳墠紿楀彛鏇挎崲鏂囨湰
銆銆CTRL+SHIFT+R 鍦ㄦ寚瀹氱獥鍙f浛鎹㈡枃鏈?/div>
銆銆ALT+SHIFT+C 鏌ユ壘淇敼鐨勬枃浠?/div>
銆銆CTRL+E 鏈榪戞墦寮鐨勬枃浠?/div>
銆銆F3 鍚戜笅鏌ユ壘鍏抽敭瀛楀嚭鐜頒綅緗?/div>
銆銆SHIFT+F3 鍚戜笂涓涓叧閿瓧鍑虹幇浣嶇疆
銆銆F4 鏌ユ壘鍙橀噺鏉ユ簮
銆銆CTRL+ALT+F7 閫変腑鐨勫瓧絎︽煡鎵懼伐紼嬪嚭鐜扮殑鍦版柟
銆銆CTRL+SHIFT+O 寮瑰嚭鏄劇ず鏌ユ壘鍐呭

銆3. 鑷姩浠g爜
銆銆ALT+鍥炶濺 瀵煎叆鍖?鑷姩淇
銆銆CTRL+ALT+L 鏍煎紡鍖栦唬鐮?/div>
銆銆CTRL+ALT+I 鑷姩緙╄繘
銆銆CTRL+ALT+O 浼樺寲瀵煎叆鐨勭被鍜屽寘
銆銆ALT+INSERT 鐢熸垚浠g爜(濡侴ET,SET鏂規(guī)硶,鏋勯犲嚱鏁扮瓑)
銆銆CTRL+E 鏈榪戞洿鏀圭殑浠g爜
銆銆CTRL+SHIFT+SPACE 鑷姩琛ュ叏浠g爜
銆銆CTRL+絀烘牸 浠g爜鎻愮ず
銆銆CTRL+ALT+SPACE 綾誨悕鎴栨帴鍙e悕鎻愮ず
銆銆CTRL+P 鏂規(guī)硶鍙傛暟鎻愮ず
銆銆CTRL+J 鑷姩浠g爜
銆銆CTRL+ALT+T 鎶婇変腑鐨勪唬鐮佹斁鍦?TRY{} IF{} ELSE{} 閲?br />
銆4. 澶嶅埗蹇嵎鏂瑰紡
銆銆CTRL+D 澶嶅埗琛?/div>
銆銆CTRL+X 鍓垏,鍒犻櫎琛?/div>
銆銆5. 鍏朵粬蹇嵎鏂瑰紡
銆銆CIRL+U 澶у皬鍐欏垏鎹?/div>
銆銆CTRL+Z 鍊掗
銆銆CTRL+SHIFT+Z 鍚戝墠
銆銆CTRL+ALT+F12 璧勬簮綆$悊鍣ㄦ墦寮鏂囦歡澶?/div>
銆銆ALT+F1 鏌ユ壘鏂囦歡鎵鍦ㄧ洰褰曚綅緗?/div>
銆銆SHIFT+ALT+INSERT 绔栫紪杈戞ā寮?/div>
銆銆CTRL+/ 娉ㄩ噴//
銆銆CTRL+SHIFT+/ 娉ㄩ噴/*...*/
銆銆CTRL+W 閫変腑浠g爜錛岃繛緇寜浼氭湁鍏朵粬鏁堟灉
銆銆CTRL+B 蹇熸墦寮鍏夋爣澶勭殑綾繪垨鏂規(guī)硶
銆銆ALT+ ←/→ 鍒囨崲浠g爜瑙嗗浘
銆銆CTRL+ALT ←/→ 榪斿洖涓婃緙栬緫鐨勪綅緗?/div>
銆銆ALT+ ↑/↓ 鍦ㄦ柟娉曢棿蹇熺Щ鍔ㄥ畾浣?/div>
銆銆SHIFT+F6 閲嶆瀯-閲嶅懡鍚?/div>
銆銆CTRL+H 鏄劇ず綾葷粨鏋勫浘
銆銆CTRL+Q 鏄劇ず娉ㄩ噴鏂囨。
銆銆ALT+1 蹇熸墦寮鎴栭殣钘忓伐紼嬮潰鏉?/div>
銆銆CTRL+SHIFT+UP/DOWN 浠g爜鍚戜笂/涓嬬Щ鍔ㄣ?/div>
銆銆CTRL+UP/DOWN 鍏夋爣璺寵漿鍒扮涓琛屾垨鏈鍚庝竴琛屼笅
銆銆ESC 鍏夋爣榪斿洖緙栬緫妗?/div>
銆銆SHIFT+ESC 鍏夋爣榪斿洖緙栬緫妗?鍏抽棴鏃犵敤鐨勭獥鍙?/div>
銆銆F1 甯姪鍗冧竾鍒寜,寰堝崱!
銆銆CTRL+F4 闈炲父閲嶈涓嬬彮閮界敤

浜屻佸父鐢ㄩ厤緗細
銆銆1. IDEA鍐呭瓨浼樺寲
銆銆鍥犳満鍣ㄦ湰韜殑閰嶇疆鑰岄厤緗細
銆銆\IntelliJ IDEA 8\bin\idea.exe.vmoptions
銆銆-----------------------------------------
銆銆-Xms64m
銆銆-Xmx256m
銆銆-XX:MaxPermSize=92m
銆銆-ea
銆銆-server
銆銆-Dsun.awt.keepWorkingSetOnMinimize=true



]]>mongdb 浣跨敤linux shell淇敼鏁版嵁http://www.tkk7.com/17learning/archive/2015/09/22/427431.html綆″厛椋?/dc:creator>綆″厛椋?/author>Tue, 22 Sep 2015 11:25:00 GMThttp://www.tkk7.com/17learning/archive/2015/09/22/427431.htmlhttp://www.tkk7.com/17learning/comments/427431.htmlhttp://www.tkk7.com/17learning/archive/2015/09/22/427431.html#Feedback0http://www.tkk7.com/17learning/comments/commentRss/427431.htmlhttp://www.tkk7.com/17learning/services/trackbacks/427431.html     /**
 * 鏃墮棿瀵硅薄鐨勬牸寮忓寲;
 */
Date.prototype.format = function(format) {
    /*
     * eg:format="YYYY-MM-dd hh:mm:ss";
     */
    var o = {
        "M+" :this.getMonth() + 1, // month
        "d+" :this.getDate(), // day
        "h+" :this.getHours(), // hour
        "m+" :this.getMinutes(), // minute
        "s+" :this.getSeconds(), // second
        "q+" :Math.floor((this.getMonth() + 3) / 3), // quarter
        "S" :this.getMilliseconds()
    // millisecond
    }
 
    if (/(y+)/.test(format)) {
        format = format.replace(RegExp.$1, (this.getFullYear() + "")
                .substr(4 - RegExp.$1.length));
    }
 
    for ( var k in o) {
        if (new RegExp("(" + k + ")").test(format)) {
            format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k]
                    : ("00" + o[k]).substr(("" + o[k]).length));
        }
    }
    return format;
}
var date =new Date();
var createdate=date.format("yyyy-MM-dd hh:mm:ss");
date.setMinutes(date.getMinutes()+5);
var validtime=date.format("yyyy-MM-dd hh:mm:ss");
db.UserOnlineInfo.update(
{
  "uid" : "110000350"
},
{$set : {
  "uid" : "110000350", 
  "createtime" : createdate,
  "validtime" : validtime
}});
db.UserOnlineInfo.update(
{
  "uid" : "110000351"
},
{$set : {
  "uid" : "110000351", 
  "createtime" : createdate,
  "validtime" : validtime
}});

2銆佺紪鍐檚hell鑴氭錛?br /> #/bin/bash
echo "update mongod begin"
cd /home/mongodb/mongodb-3.0.2/bin
./mongo  192.168.1.122:27108/YouLiao update.js;
echo "update mongod success"

3銆?鎵ц鑴氭湰錛?/div>
/home/mongodb/mongodb-3.0.2/bin/mongo  192.168.1.122:27108/YouLiao /root/www/job/mongo-test/update.js

澶囨敞錛?/div>
mongodb鏌ヨ銆佸垹闄ょ被浼?/div>

   

]]> 主站蜘蛛池模板: 91亚洲va在线天线va天堂va国产| 凹凸精品视频分类国产品免费| 亚洲国产一二三精品无码| xxxx日本在线播放免费不卡| 又大又粗又爽a级毛片免费看| 亚洲av综合av一区二区三区| 免费不卡视频一卡二卡| 亚洲国产亚洲综合在线尤物| 老司机在线免费视频| 亚洲熟妇自偷自拍另欧美| 国产成人高清精品免费鸭子| 人人爽人人爽人人片A免费| 精品国产香蕉伊思人在线在线亚洲一区二区| 免费看美女午夜大片| 亚洲欧洲∨国产一区二区三区| 日韩免费的视频在线观看香蕉| 亚洲精品网站在线观看你懂的| 永久免费毛片在线播放| 亚洲heyzo专区无码综合| 亚洲色婷婷综合开心网| 一区二区三区无码视频免费福利 | 一级女性全黄久久生活片免费 | 免费无码看av的网站| 免费国产a理论片| 亚洲AV无一区二区三区久久| aⅴ在线免费观看| 鲁死你资源站亚洲av| 国产亚洲精AA在线观看SEE| 四虎成年永久免费网站| 久久亚洲精品高潮综合色a片| 国产成人亚洲精品影院| 69视频在线是免费观看| 国产综合成人亚洲区| 亚洲国产成人高清在线观看 | 国产免费黄色无码视频| 亚洲妇女水蜜桃av网网站| 国产成人在线免费观看| 久久免费公开视频| 在线观看亚洲免费视频| 亚洲宅男永久在线| 亚洲第一页综合图片自拍|