* @param name
* @return ID of new created roomtype or null
*/
public Long addRoomType(String name){
try {
RoomTypes rtype = new RoomTypes();
rtype.setName(name);
rtype.setStarttime(new Date());
rtype.setDeleted("false");
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
rtype = session.merge(rtype);
session.flush();
long returnId = rtype.getRoomtypes_id();
tx.commit();
PersistenceSessionUtil.closeSession(idf);
return returnId;
} catch (Exception ex2) {
log.error("[addRoomType] ",ex2);