1 package za.org.coefficient.modules.mailforum; 2 3 import net.sf.hibernate.HibernateException; 4 5 import org.dithaka.metadata.ClassExpert; 6 7 import za.org.coefficient.util.common.InvokerFactory; 8 9 public abstract class CoefficientClassExpert extends ClassExpert 10 { 11 protected abstract String getClassName(); 12 protected abstract String getMethodName(); 13 14 public Object getObject(Long id) throws HibernateException { 15 try { 16 Object object = InvokerFactory.getRemoteInvoker() 17 .invokeMethodOnModule(getClassName(), getMethodName(), 18 new Object [] {id}); 19 return object; 20 } 21 catch (Exception ex) { 22 throw new HibernateException(ex); 23 } 24 } 25 26 } 27 | Popular Tags |