新聞中心
本篇內(nèi)容主要講解“SAP Hybris和ABAP Netweaver里的DAO怎么實(shí)現(xiàn)”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“SAP Hybris和ABAP Netweaver里的DAO怎么實(shí)現(xiàn)”吧!

DAO在Hybris里的定義:
A DAO (Data Access Object) is an interface to the storage back end system. DAOs store and retrieve objects. You use DAOs to save, remove, and find models. DAOs are the place to put SQL or FlexibleSearch statements and nowhere else. This is to ensure further decoupling from the underlying storage facility. DAOs interact with services via models and with the database via FlexibleSearch and SQL statements.
確實(shí)這是一個(gè)common的concept, 就是對(duì)持久層的CRUD進(jìn)行封裝,以實(shí)現(xiàn)上一層對(duì)持久層具體實(shí)現(xiàn)的解耦。

隨便抽一個(gè)ABAP的DAO實(shí)現(xiàn):

Hybris里所有DAO實(shí)現(xiàn)的super class是hybris標(biāo)準(zhǔn)的框架DAO, 定義在如下namespace里. 討論都是一個(gè)DAO作為interface定義操作,

另一個(gè)default開頭的DAO提供default實(shí)現(xiàn): 拼SQL然后call flexibile search.

這里的flexible search就相當(dāng)于ABAP的OPEN SQL, 把DB的access同具體的DB provider解耦。
runtime時(shí)具體用哪個(gè)DAO的實(shí)現(xiàn),是在Spring的配置文件里注入的:

到此,相信大家對(duì)“SAP Hybris和ABAP Netweaver里的DAO怎么實(shí)現(xiàn)”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
標(biāo)題名稱:SAPHybris和ABAPNetweaver里的DAO怎么實(shí)現(xiàn)-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)URL:http://www.dlmjj.cn/article/jpesh.html


咨詢
建站咨詢
