IvoBG wrote:
I'm trying to run the simple Message example.
Here is the Main method:
Configuration cfg = new Configuration();
cfg.addResource("hello/Message.hbm.xml");
cfg.setProperties( System.getProperties() );
SessionFactory sessions = cfg.buildSessionFactory();
Session session = sessions.openSession();
Transaction tx = session.beginTransaction();
Message message = new Message("Hello World");
session.save(message);
tx.commit();
session.close();
I've not tried it before, but I think if you do the following:
Code:
Configuration cfg = new Configuration().setProperties(System.getProperties);
cfg.addResource("hello/Message.hbm.xml");
SessionFactory sessions = cfg.buildSessionFactory();
You should have more luck.
Otherwise, let me know and I'll try to help further.
Christian.