Query query = session.createQuery("from Cloud as cld where cld.domain = ? and cld.port = ? and cld.path = ?");
query.setString(0, domain);
query.setInteger(1, port);
query.setString(2, path);
CloudIF obj = (CloudIF) query.uniqueResult();
if (obj == null) {
obj = new Cloud(domain, port, path, registerProcedure, protocol);
session.save(obj);
}