Warp-persist also requires to register the @Finder interface. See http://www.wideplay.com/dynamicfinders
It is via the .addAccessor(PersonAccess.class) instead of addFinder. The reason why you need to register all your _interfaces_ is simple. Guice has no idea how to instantiate FinderInterface. Consider @Inject MyFinderInterface This has to be backed by a concrete class! The only option is to generate backing class on the fly when addFinder is called. There is no "wildcard" provider in Guice. See http://code.google.com/p/google-guice/issues/detail?id=49 and the discussions on the mailing list if you want more. Your options are simple o) Use @Finder in concrete class instead of Interface (this works OOTB) o) Put all @Finder interfaces in selected packages and create a custom scanPackage method that will do a selective class path scanning. See how scan packages is done in Sitebricks or similar. I think full blown classpath scanning is just plain evil. But I do selective class- path scanning to great success i.e. register all @Entity from a package, register all quartz jobs from a package etc. Warp-persist works great. Still using it over guice-persist as it provides the Hibernate Native support. Cheers Alen On Feb 22, 6:18 pm, Deanna Bonds <[email protected]> wrote: > Thanks Chris. I had already found those links in my search for > documentation. The junit test case was really the only example I found > except for someone else using that same pattern on stackoverflow.com . I > am hoping the AddFinder call in the Module register is just for the unit > test as that would make using the @Finder more trouble that it is worth if > I have to do it for each domain object that I have finders. And still > haven't really seen an example of the Boxing. I am currently leaning to > using warp-persist even though it doesn't appear to be maintained for a > couple years. It has an easier interface and is documented, but I really > hate adding another library just to do finders. -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
