Exemplo n.º 1
0
  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);
    }
  }
Exemplo n.º 2
0
 public static Identifiable findByPrimaryKey(Class<? extends Identifiable> clazz, Serializable id)
     throws FindByPrimaryKeyException {
   return HibernateFactory.findByPrimaryKey(clazz, id);
 }
Exemplo n.º 3
0
 public static void initialize(Object o) throws HibernateException {
   HibernateFactory.initialize(o);
 }
Exemplo n.º 4
0
 public static boolean isInitialized(Object o) {
   return HibernateFactory.isInitialized(o);
 }
Exemplo n.º 5
0
 public static void remove(IdentifiableSupport i, PersistenceContext pc) throws RemoveException {
   HibernateFactory.remove(i, pc.session);
 }
Exemplo n.º 6
0
 public static void store(Identifiable i, PersistenceContext pc) throws StoreException {
   HibernateFactory.store(i, pc);
 }