google / google/guice

persist module is missing support for finders in concrete classes

オープン
#653 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Component-Persist imported
主要言語
Java
スター
12.7k
フォーク
1.7k
平均マージ
11分
マージ済み PR(30日)
2

説明

_From [basg81](https://code.google.com/u/basg81@gmail.com/) on September 15, 2011 17:26:34_

I've switched from warp-persist to guice-persist and see that for some reason finders on concrete classes are no longer working.

I couldn't find any information on the wiki, or through google on this topic. There must be a reason for it to be missing?

Anyway, it was easy enough to add. I'll add my code here for documentation purposes, should others have the same

(1) Create class PublicJpaFinderProxy extends JpaFinderProxy (in the same package)

(2) In the place where you install the JpaPersistModule, add:

// Install finder interceptor
Provider<EntityManager> provider = getProvider( EntityManager.class );
PublicJpaFinderProxy proxy = new PublicJpaFinderProxy( provider );
bindInterceptor( Matchers.any(), Matchers.annotatedWith( Finder.class ), proxy );

... which will behave exactly the same as the concrete finder support in warp-persist.

_Original issue: http://code.google.com/p/google-guice/issues/detail?id=653_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。