If you prefer, you can invert the Session-to-Bean relationship by using the MentaBean interface so instead of passing a bean to the session to invoke the CRUD operations you can invoke them directly on the bean instance.
You just pass the bean instance as a parameter to the session CRUD methods:
public class User { // ... } BeanSession session = new MySQLBeanSession(mgr, conn); session.insert(user); session.load(user); session.update(user); session.delete(user);
You bean class can implement the MentaBean interface or just inherit from the AbstractMentaBean class:
public class User extends AbstractMentaBean { // ... } BeanSession session = new MySQLBeanSession(mgr, conn); user.setBeanSession(session); // setter injection... user.insert(); user.load(); user.update(); user.delete();