package sample.entity;
public class PopulateMessages {
public static void main(String[] args) {
SessionFactory factory = new Configuration().configure().buildSessionFactory();
Session session = factory.openSession();
session.beginTransaction();
Message message = new Message("Hibernated");
session.save(message);
session.getTransaction().commit();
session.close();
}
}