Hi,
I'm beginning to enjoy 3.2.6 and the new HAR stuff. My entities are now all hibernate POJOs, and I'm moving on to the manager/controller layer (almost totally SLSBs).
However, there are two things about the boilerplate, I'd be grateful for opinions on...
Code:
public abstract class MyStatelessController implements SessionBean, MyController {
protected static final String HIBERNATE = "java:/hibernate/SessionFactory";
/** */
protected SessionContext ctx;
/**
* @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
*/
public void setSessionContext(SessionContext ctx) {
this.ctx = ctx;
}
/**
*
* @return
*/
protected Session getSession() {
return org.jboss.hibernate.session.SessionContext.getSession(HIBERNATE);
}
// ...and so on
1) What's the best way to get the static final String out of my SLSBs?
2) When using Session Beans I keep a copy of the context, but that causes annoying name collisions between org.jboss.hibernate.session.SessionContext and javax.ejb.SessionContext.
Any pointers?
/k1