锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲熟妇少妇任你躁在线观看,亚洲国产精品久久人人爱,国产尤物在线视精品在亚洲http://m.tkk7.com/honzeland/category/43478.html璁板綍鐐規(guī)淮銆傘傘?/description>zh-cnSat, 09 Oct 2010 05:20:35 GMTSat, 09 Oct 2010 05:20:35 GMT60GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial 鈥?Eclipse and Maven 2 showcase http://m.tkk7.com/honzeland/archive/2010/08/20/329452.htmlhonzelandhonzelandFri, 20 Aug 2010 05:01:00 GMThttp://m.tkk7.com/honzeland/archive/2010/08/20/329452.htmlhttp://m.tkk7.com/honzeland/comments/329452.htmlhttp://m.tkk7.com/honzeland/archive/2010/08/20/329452.html#Feedback0http://m.tkk7.com/honzeland/comments/commentRss/329452.htmlhttp://m.tkk7.com/honzeland/services/trackbacks/329452.htmlhttp://www.javacodegeeks.com/2010/07/gwt-2-spring-3-jpa-2-hibernate-35.html

honzeland 2010-08-20 13:01 鍙戣〃璇勮
]]>
Hibernate Annotationshttp://m.tkk7.com/honzeland/archive/2010/04/20/318875.htmlhonzelandhonzelandTue, 20 Apr 2010 09:20:00 GMThttp://m.tkk7.com/honzeland/archive/2010/04/20/318875.htmlhttp://m.tkk7.com/honzeland/comments/318875.htmlhttp://m.tkk7.com/honzeland/archive/2010/04/20/318875.html#Feedback0http://m.tkk7.com/honzeland/comments/commentRss/318875.htmlhttp://m.tkk7.com/honzeland/services/trackbacks/318875.htmlUse one single table "blank_fields" for both A and B. "blank_fields" has fields: 'ref_id', 'blank_field', 'type'. 'type' is used to identify which entity the record belongs to. Use 'type' + 'ref_id' to specify the collection of elements for one entity.

@Entity
@Table(name 
= "table_a")
public class A {
    
private Set<BlankField> blankFields = new HashSet<BlankField>();
   
    @CollectionOfElements
    @Fetch(FetchMode.SUBSELECT)
    @Enumerated(EnumType.ORDINAL)
    @JoinTable(name 
= "blank_fields", joinColumns = { @JoinColumn(name = "ref_id") })
    @Cascade(value 
= org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
    @Column(name 
= "blank_field", nullable = false)
    @SQLInsert(sql 
= "INSERT INTO blank_fields(ref_id, blank_field, type) VALUES(?,?,0)")
    @Where(clause 
= "type=0")
    
public Set<BlankField> getBlankFields() { // BlankField is an enum
        
return blankFields;
    }

    @SuppressWarnings(
"unused")
    
private void setBlankFields(Set<BlankField> blankFields) {
        
this.blankFields = blankFields;
    }
// End B

@Entity
@Table(name 
= "table_b")
public class B {
    
private Set<BlankField> blankFields = new HashSet<BlankField>();
   
    @CollectionOfElements
    @Fetch(FetchMode.SUBSELECT)
    @Enumerated(EnumType.ORDINAL)
    @JoinTable(name 
= "blank_fields", joinColumns = { @JoinColumn(name = "ref_id") })
    @Cascade(value 
= org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
    @Column(name 
= "blank_field", nullable = false)
    @SQLInsert(sql 
= "INSERT INTO blank_fields(ref_id, blank_field, type) VALUES(?,?,1)"// used for insert
    @Where(clause = "type=1"// used for query, if not @CollectionOfElements, such as @OneToMany, use @WhereJoinTable instead
    public Set<BlankField> getBlankFields() {
        
return blankFields;
    }

    @SuppressWarnings(
"unused")
    
private void setBlankFields(Set<BlankField> blankFields) {
        
this.blankFields = blankFields;
    }
}

褰撶劧榪樻湁鍏朵粬鐨勬柟寮忔潵瀹炵幇涓婇潰鐨勯渶姹傦紝涓婇潰閲囩敤鐨勫崟琛ㄦ潵璁板綍涓嶅悓瀹炰綋鐨刟ssociations錛堣繖鍎挎槸CollectionOfElements錛屽茍涓旇繑鍥炵殑鏄疭et<Enum>錛屼笉鏄疭et<Embeddable>)錛岀劧鍚庣敤'type'鏉ュ尯鍒嗕笉鍚岀殑瀹炰綋錛岃繖鏍峰仛鐨勫ソ澶勬槸錛氭暟鎹簱鍐椾綑灝戯紝鏄撲簬鎵╁睍錛屽浜庢柊鐨勫疄浣擄紝鍙渶鍔犱竴涓猼ype鍊鹼紝鑰屼笉闇鏇存敼鏁版嵁搴撹〃緇撴瀯銆傚彟澶栦竴縐嶉噰鐢ㄥ崟琛ㄧ殑鏂瑰紡鏄負(fù)姣忎釜瀹炰綋澧炲姞鏂扮殑瀛楁錛屽
"blank_fields": 'a_id', 'b_id', 'blank_field', a_id reference table_a (id), b_id reference table_b (id). 榪欐牱鍦ㄦ槧灝勭殑鏃跺欐洿綆鍗曪紝
瀵逛簬A錛屾槧灝勪負(fù)
@JoinTable(name = "blank_fields", joinColumns = { @JoinColumn(name = "a_id") })
瀵逛簬B錛屾槧灝勪負(fù)
@JoinTable(name = "blank_fields", joinColumns = { @JoinColumn(name = "b_id") })
榪欐牱浣滅殑緙虹偣鏄細(xì)甯︽潵浜?jiǎn)鏁版嵁搴撳啑浣欏Q屽浜?span style="color: #000000;">blank_fields鏉ヨ錛屼換涓鏉¤褰曪紝a_id鍜宐_id涓彧鏈変竴涓笉涓簄ull銆傚綋澶氫釜瀹炰綋鍏辯敤榪欎釜琛ㄦ椂錛岀敤涓婇潰鐨勬柟娉曟洿鍚堢悊錛屽鏋滃叡鐢ㄥ疄浣撲笉澶氭椂錛岃繖縐嶆柟娉曟洿鏂逛究銆?/span>

honzeland 2010-04-20 17:20 鍙戣〃璇勮
]]>
One Hibernate Session Multiple Transactionshttp://m.tkk7.com/honzeland/archive/2010/03/01/314150.htmlhonzelandhonzelandMon, 01 Mar 2010 03:47:00 GMThttp://m.tkk7.com/honzeland/archive/2010/03/01/314150.htmlhttp://m.tkk7.com/honzeland/comments/314150.htmlhttp://m.tkk7.com/honzeland/archive/2010/03/01/314150.html#Feedback0http://m.tkk7.com/honzeland/comments/commentRss/314150.htmlhttp://m.tkk7.com/honzeland/services/trackbacks/314150.html each transaction would NOT affect others.
i.e., open multiple transactions on the same session, even though one transaction rolls back, other transactions can be committed. If one action fails, others should fail too, then we should use one transaction for all actions.

Note:
A rollback with a single Session will lead to that Session being cleared (through "Session.clear()").
So do lazy collections still work if the session is cleared? =>Not of any objects that you loaded up until the rollback. Only for new objects loaded afterwards.
We should load necessary objects to session for each transactional action to avoid LazyInitializationException, even if those objects are loaded before other forward transactional actions, since forward action may be rolled back and clear the session.

BTW, Hibernate Session.merge() is different with Session.update() by:
Item item2 = session.merge(item);
item2 
== item; // false, item - DETACHED, item2 - PERSIST
session.update(item); // no return value, make item PERSIST




honzeland 2010-03-01 11:47 鍙戣〃璇勮
]]>
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-onlyhttp://m.tkk7.com/honzeland/archive/2010/02/24/313829.htmlhonzelandhonzelandWed, 24 Feb 2010 10:02:00 GMThttp://m.tkk7.com/honzeland/archive/2010/02/24/313829.htmlhttp://m.tkk7.com/honzeland/comments/313829.htmlhttp://m.tkk7.com/honzeland/archive/2010/02/24/313829.html#Feedback0http://m.tkk7.com/honzeland/comments/commentRss/313829.htmlhttp://m.tkk7.com/honzeland/services/trackbacks/313829.html
    @Transactional
    
public void foo() {
        
try{
            bar();
        } 
catch (RuntimeException re) {
            
// caught but not throw further
            
        }
        
    }

    @Transactional
    
public void bar() {
        
    }
濡傛灉foo鍦ㄨ皟鐢╞ar鐨勬椂鍊欙紝bar鎶涘嚭RuntimeException錛孲pring鍦╞ar return鏃跺皢Transactional鏍囪涓篟ollback only錛?鑰宖oo鎹曡幏浜?jiǎn)bar鐨凴untimeException錛屾墍浠pring灝嗕細(xì)commit foo鐨勪簨鍔★紝浣嗘槸foo鍜宐ar浣跨敤鐨勬槸鍚屼竴浜嬪姟錛屽洜姝ゅ湪commit foo浜嬪姟鏃訛紝灝嗕細(xì)鎶涘嚭UnexpectedRollbackException銆傛敞鎰忥細(xì)濡傛灉foo鍜宐ar鍦ㄥ悓涓class涓紝涓嶄細(xì)鍑虹幇榪欑鎯呭喌錛屽洜涓猴細(xì)

Since this mechanism is based on proxies, only 'external' method calls coming in through the proxy will be intercepted. This means that 'self-invocation', i.e. a method within the target object calling some other method of the target object, won't lead to an actual transaction at runtime even if the invoked method is marked with @Transactional!

鍙互閫氳繃閰嶇疆log4j鏉ebug Spring浜嬪姟鑾峰彇鎯呭喌錛?br /> To delve more into it I would turn up your log4j logging to debug and also look at what ExerciseModuleController is doing at line 91, e.g.: add a logger for org.springframework.transaction


honzeland 2010-02-24 18:02 鍙戣〃璇勮
]]>
Discussion for Open Session In View Pattern for Hibernatehttp://m.tkk7.com/honzeland/archive/2010/01/29/311244.htmlhonzelandhonzelandFri, 29 Jan 2010 09:20:00 GMThttp://m.tkk7.com/honzeland/archive/2010/01/29/311244.htmlhttp://m.tkk7.com/honzeland/comments/311244.htmlhttp://m.tkk7.com/honzeland/archive/2010/01/29/311244.html#Feedback0http://m.tkk7.com/honzeland/comments/commentRss/311244.htmlhttp://m.tkk7.com/honzeland/services/trackbacks/311244.htmlhttp://www.mail-archive.com/stripes-users@lists.sourceforge.net/msg02908.html




honzeland 2010-01-29 17:20 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 岛国av无码免费无禁网站| 国内精品久久久久影院免费| 在线观看日本免费a∨视频| 亚洲精品中文字幕麻豆| 日本免费大黄在线观看| 91在线精品亚洲一区二区| 四虎影视成人永久免费观看视频 | 亚洲人成影院在线无码按摩店| 免费看又黄又爽又猛的视频软件| 免费国产a国产片高清| 免费人成在线观看播放a| 亚洲A丁香五香天堂网| 一区二区免费国产在线观看| 免费a级毛片18以上观看精品| 免费激情网站国产高清第一页| 免费国产在线观看老王影院 | 无码人妻一区二区三区免费看| 亚洲AV中文无码乱人伦下载| 欧洲人免费视频网站在线| 老司机亚洲精品影院| 三年片在线观看免费观看高清电影| 中文字幕无码亚洲欧洲日韩| 日本一道本高清免费| 特级毛片爽www免费版| 亚洲熟女少妇一区二区| 91香焦国产线观看看免费| 亚洲精品中文字幕无乱码| 成年大片免费视频| 人妻仑乱A级毛片免费看| 亚洲va中文字幕无码久久| 人成午夜免费视频在线观看| 日韩国产欧美亚洲v片 | 国产成人无码精品久久久久免费| 久久精品国产亚洲麻豆| 桃子视频在线观看高清免费完整| 亚洲AV无码成人精品区日韩| 亚洲熟妇av一区二区三区 | **真实毛片免费观看| 无码天堂va亚洲va在线va| 久久亚洲精品无码| 免费观看的av毛片的网站|