public void configurePersistence(PlatformConfiguration pc) throws Exception { try { PlatformAnnotationConfiguration hibConfiguration = (PlatformAnnotationConfiguration) HibernateFactory.getConfig(); URL ce = HibernateFactory.class.getClassLoader().getResource("qa.hbm.xml"); hibConfiguration.addURL(ce); hibConfiguration.addAnnotatedClass(Tag.class); hibConfiguration.addAnnotatedClass(Category.class); // hibConfiguration.addAnnotatedClass(Badge.class); hibConfiguration.addAnnotatedClass(Question.class); hibConfiguration.addAnnotatedClass(QuestionRevision.class); hibConfiguration.addAnnotatedClass(Answer.class); hibConfiguration.addAnnotatedClass(AnswerRevision.class); hibConfiguration.addAnnotatedClass(Comment.class); hibConfiguration.addAnnotatedClass(Upvote.class); hibConfiguration.addAnnotatedClass(Hit.class); hibConfiguration.addAnnotatedClass(StickyNote.class); } catch (MappingException e) { throw new RuntimeException(e); } }
public static Identifiable findByPrimaryKey(Class<? extends Identifiable> clazz, Serializable id) throws FindByPrimaryKeyException { return HibernateFactory.findByPrimaryKey(clazz, id); }
public static void initialize(Object o) throws HibernateException { HibernateFactory.initialize(o); }
public static boolean isInitialized(Object o) { return HibernateFactory.isInitialized(o); }
public static void remove(IdentifiableSupport i, PersistenceContext pc) throws RemoveException { HibernateFactory.remove(i, pc.session); }
public static void store(Identifiable i, PersistenceContext pc) throws StoreException { HibernateFactory.store(i, pc); }