tysonnorris wrote:
Hi -
I am looking more closely into this design, and I'm running into an issue:
- to create NEW persistent classes, I would like to create simple JavaBean implementations. Is this possible in this design?
This design requires both a 'home' interface specifying the finders, create/remove methods and javabeans representing the objects to be persisted. The framework continues using the same EJB patterns but with a different persistence mechanism.
tysonnorris wrote:
It seems like there may be a couple of problems in attempting this:
1. does Proxy.newProxyInstance() work with concrete classes instead of interfaces? (I think it doesn't - is that correct?). If this is the case, perhaps this can be extended to use CGLIB for non-interface proxy creation (I believe this is how hibernate uses CGLIB?)
No, an interface is required.
Honestly we never thought of this. So what you want is a 'single' bean representing both the persistent class AND the finders etc? I guess CGLIB could be used for this.
tysonnorris wrote:
Basically, i would like to create a new persistent class by creating only a *single* new class, as opposed to EJB-like process of creating at least 2 classes (home and biz interfaces, and ejb implementation).
This approach requires a minimum of once class for persistence and one interface specifying the finders etc. Personally I like to keep my beans separate from these methods.