跳到主要內容

Hibernate Find By Example

當TB_FD_USER裡面的PK=USER_NO時候
只有放PK到findByExample會被忽略喔...

eStoreService dao = (eStoreService)SpringService.getService(SpringService.USE_JDBC, "eStoreService");
TbFdUser user = new TbFdUser();
user.setUserNo(new Long(1));
Collection c = dao.getUserByExample(user);
System.out.println("result size:"+c.size());

Result...
Hibernate: select this_.USER_NO as USER1_4_0_, this_.ADDRESS as ADDRESS4_0_, this_.AREA_CODE as AREA3_4_0_, this_.BANK_ACCOUNT as BANK4_4_0_, this_.BIRTHDAY as BIRTHDAY4_0_, this_.CITY as CITY4_0_, this_.COMPANY_NAME as COMPANY7_4_0_, this_.COUNTRY_CODE as COUNTRY8_4_0_, this_.CREATE_BY as CREATE9_4_0_, this_.CREATE_DATE as CREATE10_4_0_, this_.EMAIL as EMAIL4_0_, this_.FAX_NO as FAX12_4_0_, this_.FLAG as FLAG4_0_, this_.ID_NO as ID14_4_0_, this_.INTRODUCED_BY as INTRODUCED15_4_0_, this_.LOGIN_ID as LOGIN16_4_0_, this_.LOGIN_PWD as LOGIN17_4_0_, this_.MOBILE_NO as MOBILE18_4_0_, this_.PROVINCE_CODE as PROVINCE19_4_0_, this_.SEX as SEX4_0_, this_.STATUS as STATUS4_0_, this_.TEL_NO as TEL22_4_0_, this_.TITLE as TITLE4_0_, this_.UPDATE_BY as UPDATE24_4_0_, this_.UPDATE_DATE as UPDATE25_4_0_, this_.USER_NAME as USER26_4_0_, this_.USER_TYPE as USER27_4_0_ from tb_fd_user this_ where (1=1)
result size:3


eStoreService dao = (eStoreService)SpringService.getService(SpringService.USE_JDBC, "eStoreService");
TbFdUser user = new TbFdUser();
user.setUserNo(new Long(1));
user.setEmail("xxx@ooo.com");
Collection c = dao.getUserByExample(user);
System.out.println("result size:"+c.size());

Result...
Hibernate: select this_.USER_NO as USER1_4_0_, this_.ADDRESS as ADDRESS4_0_, this_.AREA_CODE as AREA3_4_0_, this_.BANK_ACCOUNT as BANK4_4_0_, this_.BIRTHDAY as BIRTHDAY4_0_, this_.CITY as CITY4_0_, this_.COMPANY_NAME as COMPANY7_4_0_, this_.COUNTRY_CODE as COUNTRY8_4_0_, this_.CREATE_BY as CREATE9_4_0_, this_.CREATE_DATE as CREATE10_4_0_, this_.EMAIL as EMAIL4_0_, this_.FAX_NO as FAX12_4_0_, this_.FLAG as FLAG4_0_, this_.ID_NO as ID14_4_0_, this_.INTRODUCED_BY as INTRODUCED15_4_0_, this_.LOGIN_ID as LOGIN16_4_0_, this_.LOGIN_PWD as LOGIN17_4_0_, this_.MOBILE_NO as MOBILE18_4_0_, this_.PROVINCE_CODE as PROVINCE19_4_0_, this_.SEX as SEX4_0_, this_.STATUS as STATUS4_0_, this_.TEL_NO as TEL22_4_0_, this_.TITLE as TITLE4_0_, this_.UPDATE_BY as UPDATE24_4_0_, this_.UPDATE_DATE as UPDATE25_4_0_, this_.USER_NAME as USER26_4_0_, this_.USER_TYPE as USER27_4_0_ from tb_fd_user this_ where (this_.EMAIL=?)
result size:1

這個網誌中的熱門文章

Oracle LISTAGG

同事介紹的一個Oracle的好用查詢:LISTAGG
SELECT A.GROUP_ID,A.KEY, LISTAGG(A.VALUE,'; ')WITHINGROUP(ORDERBYA.VALUE)as GG  fromSYS_PROPERTIESaGROUP byA.GROUP_ID,A.KEY
LISTAGG可以將group後的結果會總顯示於一個欄位 上述SQL原本A.VALUE會是一個row一個row的排列 使用LISTAGG之後,可以將A.VALUE顯示在同一個row中 並且可以指定間隔符號(在此設定為';') 針對某一些報表查詢非常有用唷 :D

Flashback Query

感謝我的好友提供的: 在Oracle好用的指令...
Flashback Query: 讓異動過的資料表回到歷史時間點 Step 1. è
show parameter undo_retention  PS: 這個參數顯示系統上設定歷史保留時間(ex: 900 = 900秒) Step 2. è CREATETABLE XXXXX_0815 ASSELECT *  FROM XXXXXASOFTIMESTAMPTO_TIMESTAMP('2011-08-15 12:00:00','YYYY-MM-DD HH24:MI:SS');
PS: 透過as of timestamp方式取出該時間點的表格資料

Xoom 3.2 Upgrade

雖然Xoom早已經更新到3.2 但是台灣遲遲沒有更新版本@@ 終於按奈不住好奇心了... XDA上找到給604(台版Xoom)的3.2版本ROM(美版的) 動手刷拉~~ 出奇的順利阿... 下面是兩個相關網址:
http://forum.xda-developers.com/showthread.php?t=1165998
http://forum.xda-developers.com/showthread.php?t=1080963
我這邊是刷第二各網址下載的3.2 ROM(http://www.mediafire.com/?adsa081m3z8uykd) 3.1的就沒去測拉... 也沒有再去破解(遲早的ㄅ:P)
使用心得: 1. 順~比3.0操頻還順 2. 原生就支援micro-sd 3. 目前看是不支援USB...缺憾@@ 4. 因為美版的關係,所以有Books跟Videos兩個APP,但是因為網路地區的關係不能用就是了... 5. 沒有原生中文輸入法,不過對我沒差...我都用Google拼音 :D