* @return the id of the newly created Rooms_Organisation or NULL
*/
public Long addRoomToOrganisation(long user_level, long rooms_id, long organisation_id){
try {
if (AuthLevelmanagement.getInstance().checkAdminLevel(user_level)){
Rooms_Organisation rOrganisation = new Rooms_Organisation();
rOrganisation.setRoom(this.getRoomById(rooms_id));
log.error("addRoomToOrganisation rooms "+rOrganisation.getRoom().getName());
rOrganisation.setStarttime(new Date());
rOrganisation.setOrganisation(Organisationmanagement.getInstance().getOrganisationById(organisation_id));
rOrganisation.setDeleted("false");
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
rOrganisation = session.merge(rOrganisation);
session.flush();
long returnId = rOrganisation.getRooms_organisation_id();
tx.commit();
PersistenceSessionUtil.closeSession(idf);
return returnId;
}
} catch (Exception ex2) {