JBoss 都可以用JPA API 的。重未 game over,  佢兩隻ORM 都得喎。

除非閣下 jboss > glassfish.. Glas ...
Flower 發表於 2013-10-10 18:45


You show me the Hibernate API, dude.

I will rather import JPA's classes/interface from JPA API for future proof if you don't have to use specific hibernate feature.

And yes, this is exactly what I am talking about. Porting from hibernate to eclipselink is a pain in the ass if you used all hibernate API.

Spring-Data just provide a layer on top of JPA/JDBC and other NoSQL db for easier coding and hide the complexity of handling all the JPA implementations/JDBC call yourself. I personally have not used it yet.

TOP

提示: 作者被禁止或刪除 內容自動屏蔽

TOP

提示: 作者被禁止或刪除 內容自動屏蔽

TOP

提示: 作者被禁止或刪除 內容自動屏蔽

TOP

唔SHOW CODE 啦。我而家講咗, 費事又版權又話偷圖/偷LINK.

    你問佢地啦, 睇下佢地有冇料幫 ...
Flower 發表於 2013-10-11 10:43


LOL.

I think you misunderstood my whole post.

I have done JPA implementation migration before. I know how troublesome it is.

I know what I am talking about.

TOP

本帖最後由 drupalspring 於 2013-10-11 15:05 編輯

現在大部份人都習慣先想table structure /ERD先,再用ERD去generate 番objects 出來。但這樣做你在想data structure ,而不是 OO。

試下當database 這些 infrastructure concern 並不存在,單純回歸只用 objects 來建模,再想下每個objects有什麼behaviour,objects和 objects 之間怎樣 collaborate 去推番每個objects應該有什麼 properties 出來,這樣更符合OO 的精神。有了objects 後先用ORM map 番相對應的table 做 persistence 都未遲。 如對software design 有興趣的朋友不妨睇下domain driven design ,睇完而你又消化到他想表達的idea,包你太開眼界。

TOP

本帖最後由 drupalspring 於 2013-10-11 15:04 編輯

回復 131# Stiggy930


   ching 我認同你的做法,best prastise 是全部用晒 JPA 的 interface ,除非你迫如無耐要用一些 JPA  provider 的specifc features。

因為我未用過eclipselink ,所以我想知為什麼你要由hibernate 轉去eclipselink? eclipselink 有什麼specifc features 或hibernate 有麼limitation  是吸引你轉?

TOP

提示: 作者被禁止或刪除 內容自動屏蔽

TOP

本帖最後由 Stiggy930 於 2013-10-11 15:28 編輯
回復  Stiggy930


   ching 我認同你的做法,best prastise 是全部用晒 JPA 的 interface ,除非你迫如無 ...
drupalspring 發表於 2013-10-11 15:02


EclipseLink is relatively more efficient than Hibernate. (i.e. fewer queries generated)

But the primary reason we were doing this was because we were migrating away from JBoss to VMware vFabric tc server because we only needed JAX-WS, JPA, JTA and JMS and not other stuff.

We used Spring stack from top to bottom. So no need EJB and other items.

TOP

提示: 作者被禁止或刪除 內容自動屏蔽

TOP