<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 35, comments - 0, trackbacks - 0, articles - 0
      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    2012年10月13日

    2012.09.19 office for mac 2011更新到14.2.4版本,最大的變化就是解決了office在pro retina中的顯示問(wèn)題。

     

    檢查并安裝更新到14.2.4之后,我的retina中office的顯示完全OK了.

    這是office for mac team的官方聲明鏈接link

    這是網(wǎng)上關(guān)于升級(jí)到14.2.4之后仍然無(wú)效的解決方法的鏈接link2.

     

    posted @ 2012-10-13 09:53 timelyxyz 閱讀(231) | 評(píng)論 (0)編輯 收藏

    2012年10月11日

    并集:Set1 union Set2

    交集:Set1 intersect Set2

    posted @ 2012-10-11 21:15 timelyxyz 閱讀(238) | 評(píng)論 (0)編輯 收藏

    2012年10月10日

    正確語(yǔ)句
    1 update jytuser set userid=(select member.userid from member where member.id=jytuser.owner_id)

     

    有2個(gè)易錯(cuò)點(diǎn): 

    1)表自關(guān)聯(lián)好像行不通。我猜想會(huì)不會(huì)和查詢時(shí)建立的索引更改有關(guān)。

    2)這種寫(xiě)法postgres不支持

    1 update jytuser,member set jytuser.userid=member.userid where jytuser.owner_id=jmember.id and jytuser.userid=0;

    報(bào)錯(cuò)如下:

     

    posted @ 2012-10-10 11:36 timelyxyz 閱讀(201) | 評(píng)論 (0)編輯 收藏

    2012年10月9日

    最近在做數(shù)據(jù)同步的項(xiàng)目,過(guò)程中接觸了spring+jdbc的開(kāi)發(fā)模式(IDE: sts),然后開(kāi)始使用maven管理項(xiàng)目。目前碰到的一個(gè)問(wèn)題是在本地添加一個(gè)repository,加的是用于連接sqlserver的驅(qū)動(dòng)包sqljdbc4.jar。我在很多maven倉(cāng)庫(kù)里都沒(méi)找到這個(gè)jar,只能手動(dòng)的下載來(lái),然后添加到本地倉(cāng)庫(kù)里。發(fā)現(xiàn)這個(gè)包好像很多人沒(méi)有添加成功,我在這里找到了解決方法http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/。

    主要步驟如下:

    1. 本地下載sqljdbc4.jar

    2. 解壓到本地文件夾中,并找到sqljdbc4.jar路徑

    3. 打開(kāi)命令窗口,執(zhí)行以下語(yǔ)句(前提:先配置好maven環(huán)境變量)

    1 C:\Users\nbxyz>mvn install:install-file -Dfile=e:\sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

    4."BUILD SUCCESS"即添加成功



    生成的pom文件如下

    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    4   <modelVersion>4.0.0</modelVersion>
    5   <groupId>com.microsoft.sqlserver</groupId>
    6   <artifactId>sqljdbc4</artifactId>
    7   <version>4.0</version>
    8   <description>POM was created from install:install-file</description>
    9 </project>

     

    posted @ 2012-10-09 14:40 timelyxyz 閱讀(311) | 評(píng)論 (0)編輯 收藏

    2012年9月26日

     1     private static Map<String, Long> getPictureHeightAndWidthMap(String picUrl) {
     2         Map<String, Long> map = new HashMap();
     3         try {
     4             URL url = new URL(picUrl);
     5             HttpURLConnection connection = (HttpURLConnection) url
     6                     .openConnection();
     7             DataInputStream in = new DataInputStream(
     8                     connection.getInputStream());
     9             BufferedImage image = ImageIO.read(in);
    10             map.put("w", image.getWidth() * 1L);
    11             map.put("h", image.getHeight() * 1L);
    12             connection.disconnect();
    13             in.close();
    14         } catch (IOException e) {
    15             e.printStackTrace();
    16         }
    17         return map;
    18     }
    19 
    20     public static Long getHeight(String picUrl) {
    21         Map<String, Long> map = getPictureHeightAndWidthMap(picUrl);
    22         return null == map.get("h") ? 0 : map.get("h");
    23     }
    24 
    25     public static Long getWidth(String picUrl) {
    26         Map<String, Long> map = getPictureHeightAndWidthMap(picUrl);
    27         return null == map.get("w") ? 0 : map.get("w");
    28     }

    posted @ 2012-09-26 09:34 timelyxyz 閱讀(416) | 評(píng)論 (0)編輯 收藏

    2012年9月22日

    Do "Show package contents" on the Eclipse.app.  
    Edit Contents/Info.plist.  
    Just above   

    </dict>
    </plist>

    Place this:  

    <key>NSHighResolutionCapable</key> 
    <true/>

    Then, log out or make a copy of the app so that OSX will notice the change.  Now, the info window will not show "Open in Low Resolution" as checked.  Launch Eclipse and enjoy your new retina awesomeness.

    solution from https://bugs.eclipse.org/bugs/show_bug.cgi?id=382972

    同樣的方法也可以解決的軟件有:Spring tool suites.

    posted @ 2012-09-22 18:27 timelyxyz 閱讀(327) | 評(píng)論 (0)編輯 收藏

    1 首先查看PATH
    命令:$PATH  
     
    2 如何設(shè)置PATH
    命令:echo "export PATH=xxxxxx:$PATH" >> ~/.bash_profile
    解釋:把"export PATH=xxxxxx:$PATH"輸出打印到~/.bash_profile中去。
     
    3 Unix知識(shí)補(bǔ)充:~/.bash_profile介紹
    mac和linux終端一般用bash來(lái)進(jìn)行解析。當(dāng)bash在讀完了整體環(huán)境變量的/etc/profile并借此調(diào)用其他配置文件后,接下來(lái)則是會(huì)讀取用戶自定義的個(gè)人配置文件。bash讀取的文件總共有三種:
    ~/.bash_profile   ~/.bash_login    ~/.profile
    其實(shí)bash再啟動(dòng)是只讀上面文件的一個(gè),而讀取的順序則是依照上面的順序。也就是說(shuō)讀到bash_profile就不讀后面的了,如果bash_profile不存在,后面的才能有機(jī)會(huì)。
    讓我們來(lái)看看bash_profile里面有什么內(nèi)容:
    命令:cat ~/.bash_profile 
    最后重啟你的終端就會(huì)有剛才設(shè)置的全局變量了?!?/div>
     【2012.02.28更新】
    最直觀的方法是:
    cd ~
    open .bash_profile
    這時(shí)候就會(huì)直接用記事本程序打開(kāi)這個(gè)配置文件,比在終端里那么設(shè)置要簡(jiǎn)單直觀多了。
    要注意一點(diǎn)那就是配置文件里的變量是會(huì)覆蓋的,比如
    export PATH=1
    export PATH=2
    那么后面的2會(huì)把前面的1覆蓋的。

    posted @ 2012-09-22 17:14 timelyxyz 閱讀(483) | 評(píng)論 (0)編輯 收藏

    2012年9月18日

    hibernate默認(rèn)的,以及網(wǎng)絡(luò)上的主流支持left join的表關(guān)系是one-to-many的,可以使用left join fetch(需要配置lazy="true" fetch="select"),也可以使用Criteria或者CriteriaQuery(link1 link2)來(lái)進(jìn)行查詢。

     

    對(duì)于many-to-one,首先我們先建兩個(gè)model:

     

    @Entity
    public class ClassOne {
    public String id;
    public boolean isDeleted;  
    }

    @Entity

    public class ClassTwo {
    public String id; 
    @ManyToOne
    public ClassOne classOne; // 父表
    public boolean isDeleted;  
    }

     目前有兩個(gè)需求:

     

    (1)select a.id,b.id from ClassTwo as b left join b.classOne as a;【正確,獲取到了所有ClassOne表的數(shù)據(jù)項(xiàng)】

    (2)select a.id,count(b.id) from ClassTwo as b left join b.classOne as a where a.isDeleted=false and b.isDeleted=false group by a.id;【count結(jié)果中把0的濾去了,沒(méi)達(dá)到我的需求】 

    對(duì)于第二種,目前我還沒(méi)找到具體的解決方法,仍需研究。 

     

    posted @ 2012-09-18 13:47 timelyxyz 閱讀(218) | 評(píng)論 (0)編輯 收藏

    2012年9月4日

    hi

    outer-join     fetch     lazy         主鍵表class     檢索策略         檢索方式
    true/false/auto     select     false         true/false     立即檢索(n+1次查詢)     所有
    -         -     no-proxy/proxy     true         延遲檢索         所有
    -         -     -         false         立即檢索(n+1次查詢)     所有
    -         join     false         true/false     inner join         QBC,get()/load()
    -         -     -         -         立即檢索(n+1次查詢)     HQL,NativeSQL
    -         join     no-proxy/proxy     false         inner join         QBC,get()/load()
    -         -     -         -         立即檢索(n+1次查詢)     HQL,NativeSQL
    -         -     -         true         inner join         QBC,get()/load()
    -         -     -         -         延遲檢索




    String hql = "select t,count(tp) from ContentTag_Post as tp     left join fetch tp.tag as t"
        + " where tp.tag=t and t.owner.id=? "
        + " and tp.isDeleted=false and t.isDeleted=false "
        + " group by t order by t.createTime desc ";


            String hql = "select t,count(tp) from ContentTag as t left join ContentTag_Post as tp "
                    + " where t.owner.id=? and t=tp.tag "
                    + " and t.isDeleted=false and tp.isDeleted=false "
                    + " group by t order by t.createTime desc ";

     Path expected for join!
    2012-08-22 12:47:37 [ERROR]  Invalid path: 'tp.tag'
    right-hand operand of a binary operator was null
    <AST>:0:0: unexpected end of subtree
    left-hand operand of a binary operator was null


    select查詢 join查詢

    @LazyToOne用法
    http://docs.jboss.org/hibernate/annotations/3.4/reference/zh_cn/html/entity.html
    Java中的transient,volatile和strictfp關(guān)鍵字
    http://www.iteye.com/topic/52957
    transient
      Java語(yǔ)言的關(guān)鍵字,用來(lái)表示一個(gè)域不是該對(duì)象串行化的一部分。當(dāng)一個(gè)對(duì)象被串行化的時(shí)候,transient型變量的值不包括在串行化的表示中,然而非transient型的變量是被包括進(jìn)去的


    class A implements Serializable {
     private String name;
     transient private String address;
    }

    那么你在串行化(IO流等)A類時(shí) 給它的name和address屬性賦值,那么你在提取A時(shí),拿到了name屬性,但是卻拿不到address屬性。




    lazy是延時(shí)的意思,如果lazy=true,那么就是說(shuō)數(shù)據(jù)庫(kù)中關(guān)聯(lián)子表的信息在hibernate容器啟動(dòng)的時(shí)候不會(huì)加載,而是在你真正的訪問(wèn)到字表非標(biāo)識(shí)字段的時(shí)候,才會(huì)去加載。
    反之,如果lazy=false的話,就是說(shuō),子表的信息會(huì)同主表信息同時(shí)加載。
    一般用只有完全用到子表信息的時(shí)候,才會(huì)lazy=false

    join 查詢的時(shí)候,是用以條語(yǔ)句查處所有記錄,包括關(guān)聯(lián)表記錄,select查出的是N+1條記錄,兩個(gè)都是差不多的,但是如果用了lazy=true,延遲加載的話,select在查詢時(shí)只會(huì)查出主表記錄,也就是1,如果其他地方也用到了數(shù)據(jù),此時(shí)就會(huì)自動(dòng)在執(zhí)行查詢,查出N,可以降低內(nèi)存消耗 .還有,hibernate是的session是輕量級(jí)的,創(chuàng)建和銷毀都不花很多資源,查詢數(shù)據(jù)也很快,這里fetch主要起這個(gè)作用    

    Path expected for join! unexpected end of subtree

    posted @ 2012-09-04 10:55 timelyxyz 閱讀(151) | 評(píng)論 (0)編輯 收藏

    主站蜘蛛池模板: 成年女人午夜毛片免费视频| 中文字幕久无码免费久久| 亚洲电影在线免费观看| 久久久久亚洲精品日久生情 | 中文字幕免费播放| 免费v片视频在线观看视频| 国产亚洲精品AAAA片APP| 精品免费国产一区二区三区| 亚洲第一街区偷拍街拍| 国产最新凸凹视频免费| 四虎精品免费永久免费视频| 亚洲精品综合久久| 国产免费阿v精品视频网址| 亚洲精品无码久久千人斩| 丁香花在线视频观看免费 | 亚洲熟妇无码AV| 麻豆国产精品入口免费观看| 亚洲资源最新版在线观看| 成人毛片18女人毛片免费视频未| 四虎成人免费影院网址| 亚洲AV无码一区二区大桥未久| 成人网站免费大全日韩国产| 久久久久久亚洲精品不卡| 全部免费毛片在线播放| 亚洲Av高清一区二区三区| 成人免费无码精品国产电影| EEUSS影院WWW在线观看免费| 中文字幕亚洲精品| 男女啪啪永久免费观看网站| 一级特黄色毛片免费看| 亚洲图片在线观看| 日本一区二区三区日本免费| 巨胸喷奶水www永久免费| 亚洲日韩在线视频| 国产成人无码免费视频97 | 亚洲精品综合一二三区在线 | 久久久亚洲精华液精华液精华液| 免费在线中文日本| 亚洲无mate20pro麻豆| 亚洲熟妇丰满多毛XXXX| 在线观看日本免费a∨视频|