openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebawag...@apache.org
Subject svn commit: r1442455 [2/5] - in /openmeetings/trunk/singlewebapp: docs/ src/META-INF/ src/org/apache/openmeetings/axis/services/ src/org/apache/openmeetings/backup/ src/org/apache/openmeetings/cli/ src/org/apache/openmeetings/data/basic/ src/org/apache...
Date Tue, 05 Feb 2013 02:44:05 GMT
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java Tue Feb  5 02:44:03 2013
@@ -40,11 +40,11 @@ import org.apache.openmeetings.data.conf
 import org.apache.openmeetings.data.user.Organisationmanagement;
 import org.apache.openmeetings.data.user.dao.UsersDao;
 import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.rooms.RoomTypes;
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.rooms.Rooms_Organisation;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.room.RoomOrganisation;
+import org.apache.openmeetings.persistence.beans.room.RoomType;
 import org.apache.openmeetings.persistence.beans.sip.asterisk.MeetMe;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.apache.openmeetings.session.ISessionManager;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
@@ -88,7 +88,7 @@ public class Roommanagement {
 	 */
 	public Long addRoomType(String name, boolean deleted) {
 		try {
-			RoomTypes rtype = new RoomTypes();
+			RoomType rtype = new RoomType();
 			rtype.setName(name);
 			rtype.setStarttime(new Date());
 			rtype.setDeleted(deleted);
@@ -106,10 +106,10 @@ public class Roommanagement {
 	 * 
 	 * @return List of RoomTypes
 	 */
-	public List<RoomTypes> getAllRoomTypes() {
+	public List<RoomType> getAllRoomTypes() {
 		try {
-			TypedQuery<RoomTypes> query = em
-					.createQuery("select c from RoomTypes as c where c.deleted <> :deleted", RoomTypes.class);
+			TypedQuery<RoomType> query = em
+					.createNamedQuery("getAllRoomTypes", RoomType.class);
 			query.setParameter("deleted", true);
 			return query.getResultList();
 		} catch (Exception ex2) {
@@ -124,15 +124,15 @@ public class Roommanagement {
 	 * @param roomtypes_id
 	 * @return RoomTypes-Object or NULL
 	 */
-	public RoomTypes getRoomTypesById(long roomtypes_id) {
+	public RoomType getRoomTypesById(long roomtypes_id) {
 		try {
-			TypedQuery<RoomTypes> query = em
-					.createQuery("select c from RoomTypes as c where c.roomtypes_id = :roomtypes_id AND c.deleted <> :deleted", RoomTypes.class);
+			TypedQuery<RoomType> query = em
+					.createNamedQuery("getRoomTypesById", RoomType.class);
 			query.setParameter("roomtypes_id", roomtypes_id);
 			query.setParameter("deleted", true);
 			List<?> ll = query.getResultList();
 			if (ll.size() > 0) {
-				return (RoomTypes) ll.get(0);
+				return (RoomType) ll.get(0);
 			}
 		} catch (Exception ex2) {
 			log.error("[getRoomTypesById] ", ex2);
@@ -147,7 +147,7 @@ public class Roommanagement {
 	 * @param rooms_id
 	 * @return
 	 */
-	public Rooms getRoomById(long user_level, long rooms_id) {
+	public Room getRoomById(long user_level, long rooms_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
 				return roomDao.get(rooms_id);
@@ -160,10 +160,10 @@ public class Roommanagement {
 		return null;
 	}
 
-	public Rooms getRoomWithCurrentUsersById(long user_level, long rooms_id) {
+	public Room getRoomWithCurrentUsersById(long user_level, long rooms_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
-				Rooms room = roomDao.get(rooms_id);
+				Room room = roomDao.get(rooms_id);
 
 				if (room != null) {
 					room.setCurrentusers(sessionManager.getClientListByRoom(room.getRooms_id()));
@@ -183,22 +183,19 @@ public class Roommanagement {
 	 * @param externalRoomId
 	 * @return Rooms-Object or NULL
 	 */
-	public Rooms getRoomByExternalId(Long externalRoomId,
+	public Room getRoomByExternalId(Long externalRoomId,
 			String externalRoomType, long roomtypes_id) {
 		log.debug("getRoombyExternalId : " + externalRoomId + " - "
 				+ externalRoomType + " - " + roomtypes_id);
 		try {
-			String hql = "select c from Rooms as c JOIN c.roomtype as rt "
-					+ "where c.externalRoomId = :externalRoomId AND c.externalRoomType = :externalRoomType "
-					+ "AND rt.roomtypes_id = :roomtypes_id AND c.deleted <> :deleted";
-			TypedQuery<Rooms> query = em.createQuery(hql, Rooms.class);
+			TypedQuery<Room> query = em.createNamedQuery("getRoomByExternalId", Room.class);
 			query.setParameter("externalRoomId", externalRoomId);
 			query.setParameter("externalRoomType", externalRoomType);
 			query.setParameter("roomtypes_id", roomtypes_id);
 			query.setParameter("deleted", true);
 			List<?> ll = query.getResultList();
 			if (ll.size() > 0) {
-				return (Rooms) ll.get(0);
+				return (Room) ll.get(0);
 			} else {
 				log.error("Could not find room " + externalRoomId);
 			}
@@ -208,7 +205,7 @@ public class Roommanagement {
 		return null;
 	}
 
-	public Rooms getRoomByExternalId(long user_level, Long externalRoomId,
+	public Room getRoomByExternalId(long user_level, Long externalRoomId,
 			String externalRoomType, long roomtypes_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
@@ -223,13 +220,13 @@ public class Roommanagement {
 		return null;
 	}
 
-	public SearchResult<Rooms> getRooms(long user_level, int start, int max,
+	public SearchResult<Room> getRooms(long user_level, int start, int max,
 			String orderby, boolean asc, String search) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
-				SearchResult<Rooms> sResult = new SearchResult<Rooms>();
+				SearchResult<Room> sResult = new SearchResult<Room>();
 				sResult.setRecords(this.selectMaxFromRooms(search));
-				sResult.setObjectName(Rooms.class.getName());
+				sResult.setObjectName(Room.class.getName());
 				sResult.setResult(this.getRoomsInternatlByHQL(start, max,
 						orderby, asc, search));
 				return sResult;
@@ -240,18 +237,18 @@ public class Roommanagement {
 		return null;
 	}
 	
-	public SearchResult<Rooms> getRoomsWithCurrentUsers(long user_level, int start,
+	public SearchResult<Room> getRoomsWithCurrentUsers(long user_level, int start,
 			int max, String orderby, boolean asc) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
-				SearchResult<Rooms> sResult = new SearchResult<Rooms>();
+				SearchResult<Room> sResult = new SearchResult<Room>();
 				sResult.setRecords(this.selectMaxFromRooms(""));
-				sResult.setObjectName(Rooms.class.getName());
+				sResult.setObjectName(Room.class.getName());
 
-				List<Rooms> rooms = this.getRoomsInternatl(start, max, orderby,
+				List<Room> rooms = this.getRoomsInternatl(start, max, orderby,
 						asc);
 
-				for (Rooms room : rooms) {
+				for (Room room : rooms) {
 					room.setCurrentusers(sessionManager.getClientListByRoom(room.getRooms_id()));
 				}
 
@@ -264,15 +261,15 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getRoomsWithCurrentUsersByList(long user_level,
+	public List<Room> getRoomsWithCurrentUsersByList(long user_level,
 			int start, int max, String orderby, boolean asc) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
 
-				List<Rooms> rooms = this.getRoomsInternatl(start, max, orderby,
+				List<Room> rooms = this.getRoomsInternatl(start, max, orderby,
 						asc);
 
-				for (Rooms room : rooms) {
+				for (Room room : rooms) {
 					room.setCurrentusers(sessionManager.getClientListByRoom(room.getRooms_id()));
 				}
 
@@ -285,16 +282,16 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getRoomsWithCurrentUsersByListAndType(long user_level,
+	public List<Room> getRoomsWithCurrentUsersByListAndType(long user_level,
 			int start, int max, String orderby, boolean asc,
 			String externalRoomType) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
 
-				List<Rooms> rooms = this.getRoomsInternatlbyType(start, max,
+				List<Room> rooms = this.getRoomsInternatlbyType(start, max,
 						orderby, asc, externalRoomType);
 
-				for (Rooms room : rooms) {
+				for (Room room : rooms) {
 					room.setCurrentusers(sessionManager.getClientListByRoom(room.getRooms_id()));
 				}
 
@@ -309,17 +306,13 @@ public class Roommanagement {
 
 	public Long selectMaxFromRooms(String search) {
 		try {
-			String hql = "select count(c.rooms_id) from Rooms c "
-					+ "where c.deleted <> true AND c.name LIKE :search ";
-
 			if (search.length() == 0) {
 				search = "%";
 			} else {
 				search = "%" + search + "%";
 			}
-
 			// get all users
-			TypedQuery<Long> query = em.createQuery(hql, Long.class);
+			TypedQuery<Long> query = em.createNamedQuery("selectMaxFromRooms", Long.class);
 			query.setParameter("search", search);
 			List<Long> ll = query.getResultList();
 			log.debug("Number of records" + ll.get(0));
@@ -340,12 +333,12 @@ public class Roommanagement {
 	 * @param asc
 	 * @return
 	 */
-	public List<Rooms> getRoomsInternatl(int start, int max, String orderby,
+	public List<Room> getRoomsInternatl(int start, int max, String orderby,
 			boolean asc) {
 		try {
 			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Rooms> cq = cb.createQuery(Rooms.class);
-			Root<Rooms> c = cq.from(Rooms.class);
+			CriteriaQuery<Room> cq = cb.createQuery(Room.class);
+			Root<Room> c = cq.from(Room.class);
 			Predicate condition = cb.equal(c.get("deleted"), false);
 			cq.where(condition);
 			cq.distinct(asc);
@@ -354,10 +347,10 @@ public class Roommanagement {
 			} else {
 				cq.orderBy(cb.desc(c.get(orderby)));
 			}
-			TypedQuery<Rooms> q = em.createQuery(cq);
+			TypedQuery<Room> q = em.createQuery(cq);
 			q.setFirstResult(start);
 			q.setMaxResults(max);
-			List<Rooms> ll = q.getResultList();
+			List<Room> ll = q.getResultList();
 			return ll;
 		} catch (Exception ex2) {
 			log.error("[getRooms ] ", ex2);
@@ -375,11 +368,11 @@ public class Roommanagement {
 	 * @param asc
 	 * @return
 	 */
-	public List<Rooms> getRoomsInternatlByHQL(int start, int max,
+	public List<Room> getRoomsInternatlByHQL(int start, int max,
 			String orderby, boolean asc, String search) {
 		try {
 
-			String hql = "select c from Rooms c "
+			String hql = "select c from Room c "
 					+ "where c.deleted <> true AND c.name LIKE :search ";
 
 			if (search.length() == 0) {
@@ -396,7 +389,7 @@ public class Roommanagement {
 					hql += " DESC";
 				}
 			}
-			TypedQuery<Rooms> query = em.createQuery(hql, Rooms.class);
+			TypedQuery<Room> query = em.createQuery(hql, Room.class);
 			query.setParameter("search", search);
 			query.setFirstResult(start);
 			query.setMaxResults(max);
@@ -409,15 +402,15 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getAllRooms() {
+	public List<Room> getAllRooms() {
 		try {
 			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Rooms> cq = cb.createQuery(Rooms.class);
-			Root<Rooms> c = cq.from(Rooms.class);
+			CriteriaQuery<Room> cq = cb.createQuery(Room.class);
+			Root<Room> c = cq.from(Room.class);
 			Predicate condition = cb.equal(c.get("deleted"), false);
 			cq.where(condition);
-			TypedQuery<Rooms> q = em.createQuery(cq);
-			List<Rooms> ll = q.getResultList();
+			TypedQuery<Room> q = em.createQuery(cq);
+			List<Room> ll = q.getResultList();
 			return ll;
 		} catch (Exception ex2) {
 			log.error("[getAllRooms]", ex2);
@@ -425,9 +418,9 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getBackupRooms() {
+	public List<Room> getBackupRooms() {
 		try {
-			return em.createNamedQuery("getBackupRooms", Rooms.class)
+			return em.createNamedQuery("getBackupRooms", Room.class)
 					.getResultList();
 		} catch (Exception e) {
 			log.error("[getBackupRooms]", e);
@@ -435,12 +428,12 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getRoomsInternatlbyType(int start, int max,
+	public List<Room> getRoomsInternatlbyType(int start, int max,
 			String orderby, boolean asc, String externalRoomType) {
 		try {
 			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Rooms> cq = cb.createQuery(Rooms.class);
-			Root<Rooms> c = cq.from(Rooms.class);
+			CriteriaQuery<Room> cq = cb.createQuery(Room.class);
+			Root<Room> c = cq.from(Room.class);
 			Predicate condition = cb.equal(c.get("deleted"), false);
 			Predicate subCondition = cb.equal(c.get("externalRoomType"),
 					externalRoomType);
@@ -451,10 +444,10 @@ public class Roommanagement {
 			} else {
 				cq.orderBy(cb.desc(c.get(orderby)));
 			}
-			TypedQuery<Rooms> q = em.createQuery(cq);
+			TypedQuery<Room> q = em.createQuery(cq);
 			q.setFirstResult(start);
 			q.setMaxResults(max);
-			List<Rooms> ll = q.getResultList();
+			List<Room> ll = q.getResultList();
 			return ll;
 		} catch (Exception ex2) {
 			log.error("[getRooms ] ", ex2);
@@ -462,18 +455,18 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms_Organisation> getOrganisationsByRoom(long user_level,
+	public List<RoomOrganisation> getOrganisationsByRoom(long user_level,
 			long rooms_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
-				String hql = "select c from Rooms_Organisation as c "
+				String hql = "select c from RoomOrganisation as c "
 						+ "where c.room.rooms_id = :rooms_id "
 						+ "AND c.deleted <> :deleted";
-				TypedQuery<Rooms_Organisation> q = em.createQuery(hql, Rooms_Organisation.class);
+				TypedQuery<RoomOrganisation> q = em.createQuery(hql, RoomOrganisation.class);
 
 				q.setParameter("rooms_id", rooms_id);
 				q.setParameter("deleted", true);
-				List<Rooms_Organisation> ll = q.getResultList();
+				List<RoomOrganisation> ll = q.getResultList();
 				return ll;
 			}
 		} catch (Exception ex2) {
@@ -489,21 +482,14 @@ public class Roommanagement {
 	 * @param roomtypes_id
 	 * @return
 	 */
-	public List<Rooms> getPublicRooms(long user_level, long roomtypes_id) {
+	public List<Room> getPublicRooms(long user_level, long roomtypes_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
-				String queryString = "SELECT r from Rooms r "
-						+ "JOIN r.roomtype as rt "
-						+ "WHERE "
-						+ "r.ispublic=:ispublic and r.deleted=:deleted and rt.roomtypes_id=:roomtypes_id";
-				TypedQuery<Rooms> q = em.createQuery(queryString, Rooms.class);
-				//
+				TypedQuery<Room> q = em.createNamedQuery("getPublicRooms", Room.class);
 				q.setParameter("ispublic", true);
 				q.setParameter("deleted", false);
 				q.setParameter("roomtypes_id", new Long(roomtypes_id));
-
-				List<Rooms> ll = q.getResultList();
-
+				List<Room> ll = q.getResultList();
 				return ll;
 			}
 		} catch (Exception ex2) {
@@ -512,13 +498,13 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getRoomsByIds(List<Integer> roomIds) {
+	public List<Room> getRoomsByIds(List<Integer> roomIds) {
 		try {
 			if (roomIds == null || roomIds.size() == 0) {
-				return new LinkedList<Rooms>();
+				return new LinkedList<Room>();
 			}
 
-			String queryString = "SELECT r from Rooms r " + "WHERE ";
+			String queryString = "SELECT r from Room r " + "WHERE ";
 
 			queryString += "(";
 
@@ -533,9 +519,9 @@ public class Roommanagement {
 
 			queryString += ")";
 
-			TypedQuery<Rooms> q = em.createQuery(queryString, Rooms.class);
+			TypedQuery<Room> q = em.createQuery(queryString, Room.class);
 
-			List<Rooms> ll = q.getResultList();
+			List<Room> ll = q.getResultList();
 
 			return ll;
 
@@ -545,20 +531,13 @@ public class Roommanagement {
 		return null;
 	}
 
-	public List<Rooms> getPublicRoomsWithoutType(long user_level) {
+	public List<Room> getPublicRoomsWithoutType(long user_level) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
-
-				String queryString = "SELECT r from Rooms r " + "WHERE "
-						+ "r.ispublic = :ispublic and r.deleted <> :deleted "
-						+ "ORDER BY r.name ASC";
-
-				TypedQuery<Rooms> q = em.createQuery(queryString, Rooms.class);
-
+				TypedQuery<Room> q = em.createNamedQuery("getPublicRoomsWithoutType", Room.class);
 				q.setParameter("ispublic", true);
 				q.setParameter("deleted", true);
-				List<Rooms> ll = q.getResultList();
-
+				List<Room> ll = q.getResultList();
 				return ll;
 			}
 		} catch (Exception ex2) {
@@ -572,23 +551,15 @@ public class Roommanagement {
 	 * Get Appointed Meetings
 	 */
 	// ---------------------------------------------------------------------------------------------
-	public List<Rooms> getAppointedMeetings(Long userid, Long user_level) {
+	public List<Room> getAppointedMeetings(Long userid, Long user_level) {
 		log.debug("Roommanagement.getAppointedMeetings");
 
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
-
-				String queryString = "SELECT r from Rooms r "
-						+ "JOIN r.roomtype as rt " + "WHERE "
-						+ "r.deleted=:deleted and r.appointment=:appointed";
-				TypedQuery<Rooms> q = em.createQuery(queryString, Rooms.class);
-				//
+				TypedQuery<Room> q = em.createNamedQuery("getAppointedMeetings", Room.class);
 				q.setParameter("appointed", true);
 				q.setParameter("deleted", false);
-
-				List<Rooms> ll = q.getResultList();
-
-				return ll;
+				return q.getResultList();
 			}
 		} catch (Exception ex2) {
 			log.error("[getAppointedMeetings] ", ex2);
@@ -599,34 +570,6 @@ public class Roommanagement {
 
 	// ---------------------------------------------------------------------------------------------
 
-	/**
-	 * get all rooms which are availible for public
-	 * 
-	 * @param user_level
-	 * @param roomtypes_id
-	 * @return
-	 */
-	public List<Rooms> getPublicRooms(long user_level) {
-		try {
-			if (authLevelManagement.checkUserLevel(user_level)) {
-				// log.error("### getPublicRooms: create Query "+roomtypes_id);
-				String queryString = "SELECT r from Rooms r "
-						+ "JOIN r.roomtype as rt " + "WHERE "
-						+ "r.ispublic=:ispublic and r.deleted=:deleted";
-				TypedQuery<Rooms> q = em.createQuery(queryString, Rooms.class);
-				//
-				q.setParameter("ispublic", true);
-				q.setParameter("deleted", false);
-
-				List<Rooms> ll = q.getResultList();
-				return ll;
-			}
-		} catch (Exception ex2) {
-			log.error("[getRoomsByOrganisation] ", ex2);
-		}
-		return null;
-	}
-
 	//TODO move it to helper or DAO
 	public String getSipNumber(long roomId) {
 		String sipEnabled = configurationDaoImpl.getConfValue("red5sip.enable", String.class, "no");
@@ -642,7 +585,7 @@ public class Roommanagement {
      * @return number of participants
      */
     public Integer getSipConferenceMembersNumber(Long rooms_id) {
-    	Rooms rooms = roomDao.get(rooms_id);
+    	Room rooms = roomDao.get(rooms_id);
     	return rooms.getMeetme() != null ? rooms.getMeetme().getMembers() : null;
     }
 
@@ -674,7 +617,7 @@ public class Roommanagement {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
 
-				Rooms r = new Rooms();
+				Room r = new Room();
 				r.setName(name);
 				r.setComment(comment);
 				r.setStarttime(new Date());
@@ -759,7 +702,7 @@ public class Roommanagement {
 
 		try {
 			if (authLevelManagement.checkModLevel(user_level)) {
-				Rooms r = new Rooms();
+				Room r = new Room();
 				r.setName(name);
 				r.setComment(comment);
 				r.setStarttime(new Date());
@@ -814,7 +757,7 @@ public class Roommanagement {
 		log.debug("addExternalRoom");
 
 		try {
-			Rooms r = new Rooms();
+			Room r = new Room();
 			r.setName(name);
 			r.setComment(comment);
 			r.setStarttime(new Date());
@@ -879,7 +822,7 @@ public class Roommanagement {
 			long organisation_id) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
-				Rooms_Organisation rOrganisation = new Rooms_Organisation();
+				RoomOrganisation rOrganisation = new RoomOrganisation();
 				rOrganisation.setRoom(roomDao.get(rooms_id));
 				log.debug("addRoomToOrganisation rooms '"
 						+ rOrganisation.getRoom().getName() + "'");
@@ -898,7 +841,7 @@ public class Roommanagement {
 		return null;
 	}
 
-	public Long addRoomOrganisation(Rooms_Organisation rOrganisation) {
+	public Long addRoomOrganisation(RoomOrganisation rOrganisation) {
 		try {
 
 			rOrganisation.setStarttime(new Date());
@@ -918,18 +861,18 @@ public class Roommanagement {
 	 * @param rooms_organisation_id
 	 * @return
 	 */
-	public Rooms_Organisation getRoomsOrganisationById(
+	public RoomOrganisation getRoomsOrganisationById(
 			long rooms_organisation_id) {
 		try {
 			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Rooms_Organisation> cq = cb
-					.createQuery(Rooms_Organisation.class);
-			Root<Rooms_Organisation> c = cq.from(Rooms_Organisation.class);
+			CriteriaQuery<RoomOrganisation> cq = cb
+					.createQuery(RoomOrganisation.class);
+			Root<RoomOrganisation> c = cq.from(RoomOrganisation.class);
 			Predicate condition = cb.equal(c.get("rooms_organisation_id"),
 					rooms_organisation_id);
 			cq.where(condition);
-			TypedQuery<Rooms_Organisation> q = em.createQuery(cq);
-			List<Rooms_Organisation> ll = q.getResultList();
+			TypedQuery<RoomOrganisation> q = em.createQuery(cq);
+			List<RoomOrganisation> ll = q.getResultList();
 
 			if (ll.size() > 0) {
 				return ll.get(0);
@@ -948,22 +891,16 @@ public class Roommanagement {
 	 * @param roomtypes_id
 	 * @return
 	 */
-	public List<Rooms_Organisation> getRoomsOrganisationByOrganisationIdAndRoomType(
+	public List<RoomOrganisation> getRoomsOrganisationByOrganisationIdAndRoomType(
 			long user_level, long organisation_id, long roomtypes_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
-				String hql = "select c from Rooms_Organisation as c "
-						+ "where c.room.roomtypes_id = :roomtypes_id "
-						+ "AND c.organisation.organisation_id = :organisation_id "
-						+ "AND c.deleted <> :deleted";
-				TypedQuery<Rooms_Organisation> q = em.createQuery(hql, Rooms_Organisation.class);
-
+				TypedQuery<RoomOrganisation> q = em.
+						createNamedQuery("getRoomsOrganisationByOrganisationIdAndRoomType", RoomOrganisation.class);
 				q.setParameter("roomtypes_id", roomtypes_id);
 				q.setParameter("organisation_id", organisation_id);
 				q.setParameter("deleted", true);
-				List<Rooms_Organisation> ll = q.getResultList();
-
-				return ll;
+				return q.getResultList();
 			} else {
 				log.error("[notauthentificated] " + user_level);
 			}
@@ -979,24 +916,18 @@ public class Roommanagement {
 	 * @param organisation_id
 	 * @return list of Rooms_Organisation with Rooms as Sub-Objects or null
 	 */
-	public List<Rooms_Organisation> getRoomsOrganisationByOrganisationId(
+	public List<RoomOrganisation> getRoomsOrganisationByOrganisationId(
 			long user_level, long organisation_id) {
 		try {
 			if (authLevelManagement.checkUserLevel(user_level)) {
 
-				String hql = "SELECT c FROM Rooms_Organisation c "
-						+ "LEFT JOIN FETCH c.room "
-						+ "WHERE c.organisation.organisation_id = :organisation_id "
-						+ "AND c.deleted <> :deleted AND c.room.deleted <> :deleted AND c.room.appointment = false "
-						+ "AND c.organisation.deleted <> :deleted "
-						+ "ORDER BY c.room.name ASC";
-
-				TypedQuery<Rooms_Organisation> query = em.createQuery(hql, Rooms_Organisation.class);
+				TypedQuery<RoomOrganisation> query = em.
+						createNamedQuery("getRoomsOrganisationByOrganisationId", RoomOrganisation.class);
 
 				query.setParameter("organisation_id", organisation_id);
 				query.setParameter("deleted", true);
 
-				List<Rooms_Organisation> ll = query.getResultList();
+				List<RoomOrganisation> ll = query.getResultList();
 
 				return ll;
 			} else {
@@ -1009,14 +940,14 @@ public class Roommanagement {
 		return null;
 	}
 
-	public SearchResult<Rooms_Organisation> getRoomsOrganisationByOrganisationId(long user_level,
+	public SearchResult<RoomOrganisation> getRoomsOrganisationByOrganisationId(long user_level,
 			long organisation_id, int start, int max, String orderby,
 			boolean asc) {
 		try {
 			if (authLevelManagement.checkModLevel(user_level)) {
 
-				SearchResult<Rooms_Organisation> sResult = new SearchResult<Rooms_Organisation>();
-				sResult.setObjectName(Rooms_Organisation.class.getName());
+				SearchResult<RoomOrganisation> sResult = new SearchResult<RoomOrganisation>();
+				sResult.setObjectName(RoomOrganisation.class.getName());
 				sResult.setRecords(this.selectMaxFromRoomsByOrganisation(
 						organisation_id).longValue());
 				sResult.setResult(this.getRoomsOrganisationByOrganisationId(
@@ -1032,14 +963,11 @@ public class Roommanagement {
 	public Integer selectMaxFromRoomsByOrganisation(long organisation_id) {
 		try {
 			// get all users
-			String hql = "select c from Rooms_Organisation as c "
-					+ "where c.organisation.organisation_id = :organisation_id "
-					+ "AND c.deleted <> :deleted";
-			TypedQuery<Rooms_Organisation> q = em.createQuery(hql, Rooms_Organisation.class);
+			TypedQuery<RoomOrganisation> q = em.createNamedQuery("selectMaxFromRoomsByOrganisation", RoomOrganisation.class);
 
 			q.setParameter("organisation_id", organisation_id);
 			q.setParameter("deleted", true);
-			List<Rooms_Organisation> ll = q.getResultList();
+			List<RoomOrganisation> ll = q.getResultList();
 
 			return ll.size();
 		} catch (Exception ex2) {
@@ -1057,11 +985,11 @@ public class Roommanagement {
 	 * @param asc
 	 * @return
 	 */
-	private List<Rooms_Organisation> getRoomsOrganisationByOrganisationId(
+	private List<RoomOrganisation> getRoomsOrganisationByOrganisationId(
 			long organisation_id, int start, int max, String orderby,
 			boolean asc) {
 		try {
-			String hql = "select c from Rooms_Organisation as c "
+			String hql = "select c from RoomOrganisation as c "
 					+ "where c.organisation.organisation_id = :organisation_id "
 					+ "AND c.deleted <> :deleted";
 			if (orderby.startsWith("c.")) {
@@ -1075,13 +1003,13 @@ public class Roommanagement {
 				hql += " DESC";
 			}
 
-			TypedQuery<Rooms_Organisation> q = em.createQuery(hql, Rooms_Organisation.class);
+			TypedQuery<RoomOrganisation> q = em.createQuery(hql, RoomOrganisation.class);
 
 			q.setParameter("organisation_id", organisation_id);
 			q.setParameter("deleted", true);
 			q.setFirstResult(start);
 			q.setMaxResults(max);
-			List<Rooms_Organisation> ll = q.getResultList();
+			List<RoomOrganisation> ll = q.getResultList();
 
 			return ll;
 		} catch (Exception ex2) {
@@ -1090,19 +1018,16 @@ public class Roommanagement {
 		return null;
 	}
 
-	private Rooms_Organisation getRoomsOrganisationByOrganisationIdAndRoomId(
+	private RoomOrganisation getRoomsOrganisationByOrganisationIdAndRoomId(
 			long organisation_id, long rooms_id) {
 		try {
-			String hql = "select c from Rooms_Organisation as c "
-					+ "where c.room.rooms_id = :rooms_id "
-					+ "AND c.organisation.organisation_id = :organisation_id "
-					+ "AND c.deleted <> :deleted";
-			TypedQuery<Rooms_Organisation> q = em.createQuery(hql, Rooms_Organisation.class);
+			TypedQuery<RoomOrganisation> q = em.
+					createNamedQuery("getRoomsOrganisationByOrganisationIdAndRoomId", RoomOrganisation.class);
 
 			q.setParameter("rooms_id", rooms_id);
 			q.setParameter("organisation_id", organisation_id);
 			q.setParameter("deleted", true);
-			List<Rooms_Organisation> ll = q.getResultList();
+			List<RoomOrganisation> ll = q.getResultList();
 
 			if (ll.size() > 0) {
 				return ll.get(0);
@@ -1118,31 +1043,26 @@ public class Roommanagement {
 	 * @param organisation_id
 	 * @return
 	 */
-	public List<Rooms_Organisation> getRoomsOrganisationByRoomsId(long rooms_id) {
+	public List<RoomOrganisation> getRoomsOrganisationByRoomsId(long rooms_id) {
 		try {
-			String hql = "select c from Rooms_Organisation as c "
-					+ "where c.room.rooms_id = :rooms_id "
-					+ "AND c.deleted <> :deleted";
-			TypedQuery<Rooms_Organisation> q = em.createQuery(hql, Rooms_Organisation.class);
-
+			TypedQuery<RoomOrganisation> q = em.createNamedQuery("getRoomsOrganisationByRoomsId", RoomOrganisation.class);
 			q.setParameter("rooms_id", rooms_id);
 			q.setParameter("deleted", true);
-			List<Rooms_Organisation> ll = q.getResultList();
-			return ll;
+			return q.getResultList();
 		} catch (Exception ex2) {
 			log.error("[getRoomsByOrganisation] ", ex2);
 		}
 		return null;
 	}
 
-	public List<Rooms_Organisation> getRoomsOrganisations() {
+	public List<RoomOrganisation> getRoomsOrganisations() {
 		try {
 			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Rooms_Organisation> cq = cb
-					.createQuery(Rooms_Organisation.class);
-			cq.from(Rooms_Organisation.class);
-			TypedQuery<Rooms_Organisation> q = em.createQuery(cq);
-			List<Rooms_Organisation> ll = q.getResultList();
+			CriteriaQuery<RoomOrganisation> cq = cb
+					.createQuery(RoomOrganisation.class);
+			cq.from(RoomOrganisation.class);
+			TypedQuery<RoomOrganisation> q = em.createQuery(cq);
+			List<RoomOrganisation> ll = q.getResultList();
 			return ll;
 		} catch (Exception ex2) {
 			log.error("[getRoomsByOrganisation] ", ex2);
@@ -1159,19 +1079,19 @@ public class Roommanagement {
 	private boolean checkUserOrgRoom(long user_id, long rooms_id) {
 		try {
 
-			Users us = usersDao.get(user_id);
+			User us = usersDao.get(user_id);
 			List<Organisation_Users> s = us.getOrganisation_users();
 
 			for (Iterator<Organisation_Users> it = s.iterator(); it.hasNext();) {
 				Organisation_Users orgUsers = it.next();
 				long organisation_id = orgUsers.getOrganisation()
 						.getOrganisation_id();
-				List<Rooms_Organisation> ll = this
+				List<RoomOrganisation> ll = this
 						.getRoomsOrganisationByOrganisationId(3,
 								organisation_id);
-				for (Iterator<Rooms_Organisation> it2 = ll.iterator(); it2
+				for (Iterator<RoomOrganisation> it2 = ll.iterator(); it2
 						.hasNext();) {
-					Rooms_Organisation roomOrg = it2.next();
+					RoomOrganisation roomOrg = it2.next();
 					if (roomOrg.getRoom().getRooms_id() == rooms_id) {
 						return true;
 					}
@@ -1195,14 +1115,14 @@ public class Roommanagement {
 	 * @param comment
 	 * @return
 	 */
-	public Rooms updateRoomsSelf(long user_id, long user_level, long rooms_id,
+	public Room updateRoomsSelf(long user_id, long user_level, long rooms_id,
 			long roomtypes_id, String name, boolean ispublic, String comment) {
 		try {
 			if (authLevelManagement.checkModLevel(user_level)) {
 
 				if (this.checkUserOrgRoom(user_id, rooms_id)) {
 
-					Rooms r = roomDao.get(rooms_id);
+					Room r = roomDao.get(rooms_id);
 					r.setComment(comment);
 					r.setIspublic(ispublic);
 					r.setName(name);
@@ -1289,7 +1209,7 @@ public class Roommanagement {
 		try {
 			log.debug("*** updateRoom numberOfPartizipants: "
 					+ numberOfPartizipants);
-			Rooms r = roomDao.get(rooms_id);
+			Room r = roomDao.get(rooms_id);
 			r.setComment(comment);
 
 			r.setIspublic(ispublic);
@@ -1372,7 +1292,7 @@ public class Roommanagement {
 			log.debug("*** updateRoom numberOfPartizipants: "
 					+ numberOfPartizipants);
 			if (authLevelManagement.checkModLevel(user_level)) {
-				Rooms r = roomDao.get(rooms_id);
+				Room r = roomDao.get(rooms_id);
 				r.setComment(comment);
 
 				r.setIspublic(ispublic);
@@ -1417,7 +1337,7 @@ public class Roommanagement {
 	private boolean checkRoomAlreadyInOrg(Long orgid, List organisations)
 			throws Exception {
 		for (Iterator it = organisations.iterator(); it.hasNext();) {
-			Rooms_Organisation rOrganisation = (Rooms_Organisation) it.next();
+			RoomOrganisation rOrganisation = (RoomOrganisation) it.next();
 			if (rOrganisation.getOrganisation().getOrganisation_id()
 					.equals(orgid))
 				return true;
@@ -1435,9 +1355,9 @@ public class Roommanagement {
 		return false;
 	}
 
-	private Long updateRoomOrganisations(List<Integer> organisations, Rooms room)
+	private Long updateRoomOrganisations(List<Integer> organisations, Room room)
 			throws Exception {
-		List<Rooms_Organisation> roomOrganisations = this.getOrganisationsByRoom(3,
+		List<RoomOrganisation> roomOrganisations = this.getOrganisationsByRoom(3,
 				room.getRooms_id());
 
 		List<Long> roomsToAdd = new LinkedList<Long>();
@@ -1450,8 +1370,8 @@ public class Roommanagement {
 				roomsToAdd.add(orgIdToAdd);
 		}
 
-		for (Iterator<Rooms_Organisation> it = roomOrganisations.iterator(); it.hasNext();) {
-			Rooms_Organisation rOrganisation = it.next();
+		for (Iterator<RoomOrganisation> it = roomOrganisations.iterator(); it.hasNext();) {
+			RoomOrganisation rOrganisation = it.next();
 			Long orgIdToDel = rOrganisation.getOrganisation()
 					.getOrganisation_id();
 			if (!this.checkRoomShouldByDeleted(orgIdToDel, organisations))
@@ -1502,7 +1422,7 @@ public class Roommanagement {
 		try {
 			List ll = this.getRoomsOrganisationByRoomsId(rooms_id);
 			for (Iterator it = ll.iterator(); it.hasNext();) {
-				Rooms_Organisation rOrg = (Rooms_Organisation) it.next();
+				RoomOrganisation rOrg = (RoomOrganisation) it.next();
 				this.deleteRoomsOrganisation(rOrg);
 			}
 		} catch (Exception ex2) {
@@ -1521,7 +1441,7 @@ public class Roommanagement {
 			List ll = this.getRoomsOrganisationByOrganisationId(3,
 					organisation_id);
 			for (Iterator it = ll.iterator(); it.hasNext();) {
-				Rooms_Organisation rOrg = (Rooms_Organisation) it.next();
+				RoomOrganisation rOrg = (RoomOrganisation) it.next();
 				this.deleteRoomsOrganisation(rOrg);
 			}
 		} catch (Exception ex2) {
@@ -1536,7 +1456,7 @@ public class Roommanagement {
 	 */
 	public Long deleteRoomsOrganisationByID(long rooms_organisation_id) {
 		try {
-			Rooms_Organisation rOrg = this
+			RoomOrganisation rOrg = this
 					.getRoomsOrganisationById(rooms_organisation_id);
 			return this.deleteRoomsOrganisation(rOrg);
 		} catch (Exception ex2) {
@@ -1548,7 +1468,7 @@ public class Roommanagement {
 	private Long deleteRoomFromOrganisationByRoomAndOrganisation(long rooms_id,
 			long organisation_id) {
 		try {
-			Rooms_Organisation rOrganisation = this
+			RoomOrganisation rOrganisation = this
 					.getRoomsOrganisationByOrganisationIdAndRoomId(
 							organisation_id, rooms_id);
 			return this.deleteRoomsOrganisation(rOrganisation);
@@ -1563,7 +1483,7 @@ public class Roommanagement {
 	 * 
 	 * @param rOrg
 	 */
-	public Long deleteRoomsOrganisation(Rooms_Organisation rOrg) {
+	public Long deleteRoomsOrganisation(RoomOrganisation rOrg) {
 		try {
 			rOrg.setDeleted(true);
 			rOrg.setUpdatetime(new Date());
@@ -1586,7 +1506,7 @@ public class Roommanagement {
 	public void closeRoom(Long rooms_id, Boolean status) {
 		try {
 
-			Rooms room = roomDao.get(rooms_id);
+			Room room = roomDao.get(rooms_id);
 
 			room.setIsClosed(status);
 
@@ -1603,7 +1523,7 @@ public class Roommanagement {
 	 * @param rooms_id
 	 * @return Rooms-Object or NULL
 	 */
-	public Rooms getRoomByOwnerAndTypeId(Long ownerId, Long roomtypesId,
+	public Room getRoomByOwnerAndTypeId(Long ownerId, Long roomtypesId,
 			String roomName) {
 		try {
 
@@ -1612,19 +1532,12 @@ public class Roommanagement {
 			}
 			log.debug("getRoomByOwnerAndTypeId : " + ownerId + " || "
 					+ roomtypesId);
-
-			String hql = "select c from Rooms as c "
-					+ "where c.ownerId = :ownerId "
-					+ "AND c.roomtype.roomtypes_id = :roomtypesId "
-					+ "AND c.deleted <> :deleted";
-
-			Rooms room = null;
-
-			TypedQuery<Rooms> query = em.createQuery(hql, Rooms.class);
+			Room room = null;
+			TypedQuery<Room> query = em.createNamedQuery("getRoomByOwnerAndTypeId", Room.class);
 			query.setParameter("ownerId", ownerId);
 			query.setParameter("roomtypesId", roomtypesId);
 			query.setParameter("deleted", true);
-			List<Rooms> ll = query.getResultList();
+			List<Room> ll = query.getResultList();
 			if (ll.size() > 0) {
 				room = ll.get(0);
 			}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/ClientDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/ClientDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/ClientDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/ClientDao.java Tue Feb  5 02:44:03 2013
@@ -27,7 +27,7 @@ import javax.persistence.Query;
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.persistence.beans.basic.Server;
-import org.apache.openmeetings.persistence.beans.rooms.Client;
+import org.apache.openmeetings.persistence.beans.room.Client;
 import org.springframework.transaction.annotation.Transactional;
 
 /**

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomDao.java Tue Feb  5 02:44:03 2013
@@ -26,34 +26,34 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.data.IDataProviderDao;
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
+import org.apache.openmeetings.persistence.beans.room.Room;
 import org.apache.openmeetings.utils.DaoHelper;
 import org.springframework.transaction.annotation.Transactional;
 
 @Transactional
-public class RoomDao implements IDataProviderDao<Rooms> {
+public class RoomDao implements IDataProviderDao<Room> {
 	
 	public final static String[] searchFields = {"name"};
 	
 	@PersistenceContext
 	private EntityManager em;
 
-	public Rooms get(long id) {
-		TypedQuery<Rooms> q = em.createNamedQuery("getRoomById", Rooms.class);
+	public Room get(long id) {
+		TypedQuery<Room> q = em.createNamedQuery("getRoomById", Room.class);
 		q.setParameter("id", id);
-		List<Rooms> l = q.getResultList();
+		List<Room> l = q.getResultList();
 		return l.isEmpty() ? null : l.get(0);
 	}
 
-	public List<Rooms> get(int start, int count) {
-		TypedQuery<Rooms> q = em.createNamedQuery("getNondeletedRooms", Rooms.class);
+	public List<Room> get(int start, int count) {
+		TypedQuery<Room> q = em.createNamedQuery("getNondeletedRooms", Room.class);
 		q.setFirstResult(start);
 		q.setMaxResults(count);
 		return q.getResultList();
 	}
 
-	public List<Rooms> get(String search, int start, int count, String sort) {
-		TypedQuery<Rooms> q = em.createQuery(DaoHelper.getSearchQuery("Rooms", "r", search, true, false, sort, searchFields), Rooms.class);
+	public List<Room> get(String search, int start, int count, String sort) {
+		TypedQuery<Room> q = em.createQuery(DaoHelper.getSearchQuery("Rooms", "r", search, true, false, sort, searchFields), Room.class);
 		q.setFirstResult(start);
 		q.setMaxResults(count);
 		return q.getResultList();
@@ -69,8 +69,8 @@ public class RoomDao implements IDataPro
 		return q.getSingleResult();
 	}
 
-	public List<Rooms> getPublicRooms() {
-		return em.createNamedQuery("getPublicRoomsOrdered", Rooms.class)
+	public List<Room> getPublicRooms() {
+		return em.createNamedQuery("getPublicRoomsOrdered", Room.class)
 				.getResultList();
 	}
 	
@@ -80,18 +80,18 @@ public class RoomDao implements IDataPro
 		return q.getResultList();
 	}
 
-	public List<Rooms> getOrganisationRooms(long orgId) {
-		TypedQuery<Rooms> q = em.createQuery(
-				"SELECT DISTINCT c.room FROM Rooms_Organisation c LEFT JOIN FETCH c.room "
+	public List<Room> getOrganisationRooms(long orgId) {
+		TypedQuery<Room> q = em.createQuery(
+				"SELECT DISTINCT c.room FROM RoomOrganisation c LEFT JOIN FETCH c.room "
 				+ "WHERE c.organisation.organisation_id = :orgId "
 				+ "AND c.deleted = false AND c.room.deleted = false AND c.room.appointment = false "
 				+ "AND c.organisation.deleted = false "
-				+ "ORDER BY c.room.name ASC", Rooms.class);
+				+ "ORDER BY c.room.name ASC", Room.class);
 		q.setParameter("orgId", orgId);
 		return q.getResultList();
 	}
 	
-	public Rooms update(Rooms entity, long userId) {
+	public Room update(Room entity, long userId) {
 		if (entity.getRooms_id() == null) {
 			entity.setStarttime(new Date());
 			em.persist(entity);
@@ -102,7 +102,7 @@ public class RoomDao implements IDataPro
 		return entity;
 	}
 
-	public void delete(Rooms entity, long userId) {
+	public void delete(Room entity, long userId) {
 		entity.setDeleted(true);
 		update(entity, userId);
 	}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java Tue Feb  5 02:44:03 2013
@@ -30,8 +30,8 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.data.user.Usermanagement;
-import org.apache.openmeetings.persistence.beans.rooms.RoomModerators;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.RoomModerator;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -53,10 +53,10 @@ public class RoomModeratorsDao {
 	 * @param isSuperModerator
 	 * @return
 	 */
-	public Long addRoomModeratorByUserId(Users us, Boolean isSuperModerator,
+	public Long addRoomModeratorByUserId(User us, Boolean isSuperModerator,
 			Long roomId) {
 		try {
-			RoomModerators rModerator = new RoomModerators();
+			RoomModerator rModerator = new RoomModerator();
 			rModerator.setUser(us);
 			rModerator.setIsSuperModerator(isSuperModerator);
 			rModerator.setStarttime(new Date());
@@ -71,7 +71,7 @@ public class RoomModeratorsDao {
 		return null;
 	}
 
-	public Long addRoomModeratorByObj(RoomModerators rModerator) {
+	public Long addRoomModeratorByObj(RoomModerator rModerator) {
 		try {
 			rModerator.setStarttime(new Date());
 			rModerator = em.merge(rModerator);
@@ -88,20 +88,15 @@ public class RoomModeratorsDao {
 	 * 
 	 * @return List of RoomTypes
 	 */
-	public RoomModerators getRoomModeratorById(Long roomModeratorsId) {
+	public RoomModerator getRoomModeratorById(Long roomModeratorsId) {
 		try {
-			String hql = "select c from RoomModerators as c where c.roomModeratorsId = :roomModeratorsId";
-
-			TypedQuery<RoomModerators> query = em.createQuery(hql, RoomModerators.class);
-
+			TypedQuery<RoomModerator> query = em.createNamedQuery("getRoomModeratorById", RoomModerator.class);
 			query.setParameter("roomModeratorsId", roomModeratorsId);
-
-			RoomModerators roomModerators = null;
+			RoomModerator roomModerators = null;
 			try {
 				roomModerators = query.getSingleResult();
 			} catch (NoResultException ex) {
 			}
-
 			return roomModerators;
 
 		} catch (Exception ex2) {
@@ -110,21 +105,12 @@ public class RoomModeratorsDao {
 		return null;
 	}
 
-	public List<RoomModerators> getRoomModeratorByRoomId(Long roomId) {
+	public List<RoomModerator> getRoomModeratorByRoomId(Long roomId) {
 		try {
-
-			String hql = "select c from RoomModerators as c "
-					+ "where c.roomId = :roomId AND c.deleted <> :deleted";
-
-			TypedQuery<RoomModerators> query = em.createQuery(hql, RoomModerators.class);
-
+			TypedQuery<RoomModerator> query = em.createQuery("getRoomModeratorByRoomId", RoomModerator.class);
 			query.setParameter("deleted", true);
 			query.setParameter("roomId", roomId);
-
-			List<RoomModerators> roomModerators = query.getResultList();
-
-			return roomModerators;
-
+			return query.getResultList();
 		} catch (Exception ex2) {
 			log.error("[getRoomModeratorByRoomId] ", ex2);
 			ex2.printStackTrace();
@@ -132,25 +118,14 @@ public class RoomModeratorsDao {
 		return null;
 	}
 
-	public List<RoomModerators> getRoomModeratorByUserAndRoomId(Long roomId,
+	public List<RoomModerator> getRoomModeratorByUserAndRoomId(Long roomId,
 			Long user_id) {
 		try {
-
-			String hql = "select c from RoomModerators as c "
-					+ "where c.roomId = :roomId "
-					+ "AND c.deleted <> :deleted "
-					+ "AND c.user.user_id = :user_id";
-
-			TypedQuery<RoomModerators> query = em.createQuery(hql, RoomModerators.class);
-
+			TypedQuery<RoomModerator> query = em.createNamedQuery("getRoomModeratorByUserAndRoomId", RoomModerator.class);
 			query.setParameter("deleted", true);
 			query.setParameter("roomId", roomId);
 			query.setParameter("user_id", user_id);
-
-			List<RoomModerators> roomModerators = query.getResultList();
-
-			return roomModerators;
-
+			return query.getResultList();
 		} catch (Exception ex2) {
 			log.error("[getRoomModeratorByUserAndRoomId] ", ex2);
 			ex2.printStackTrace();
@@ -164,7 +139,7 @@ public class RoomModeratorsDao {
 	 */
 	public void removeRoomModeratorByUserId(Long roomModeratorsId) {
 		try {
-			RoomModerators rModerator = this
+			RoomModerator rModerator = this
 					.getRoomModeratorById(roomModeratorsId);
 
 			if (rModerator == null) {
@@ -190,7 +165,7 @@ public class RoomModeratorsDao {
 	public void updateRoomModeratorByUserId(Long roomModeratorsId,
 			Boolean isSuperModerator) {
 		try {
-			RoomModerators rModerator = this
+			RoomModerator rModerator = this
 					.getRoomModeratorById(roomModeratorsId);
 
 			if (rModerator == null) {
@@ -245,7 +220,7 @@ public class RoomModeratorsDao {
 		try {
 
 			// getLsit of RoomModerators before you add new ones
-			List<RoomModerators> remoteRoomModeratorList = this
+			List<RoomModerator> remoteRoomModeratorList = this
 					.getRoomModeratorByRoomId(roomId);
 
 			for (Iterator<Map<String, Object>> iter = roomModerators.iterator(); iter
@@ -277,11 +252,11 @@ public class RoomModeratorsDao {
 			}
 
 			// Check for items to delete
-			List<RoomModerators> roomModeratorsToDelete = new LinkedList<RoomModerators>();
+			List<RoomModerator> roomModeratorsToDelete = new LinkedList<RoomModerator>();
 
 			if (remoteRoomModeratorList != null) {
 
-				for (RoomModerators roomModerator : remoteRoomModeratorList) {
+				for (RoomModerator roomModerator : remoteRoomModeratorList) {
 
 					boolean found = false;
 
@@ -308,7 +283,7 @@ public class RoomModeratorsDao {
 
 			}
 
-			for (RoomModerators rModerator : roomModeratorsToDelete) {
+			for (RoomModerator rModerator : roomModeratorsToDelete) {
 				System.out.println("Remove Map "
 						+ rModerator.getRoomModeratorsId());
 				this.removeRoomModeratorByUserId(rModerator

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java Tue Feb  5 02:44:03 2013
@@ -104,7 +104,7 @@ public class FlvRecordingDao {
 			
 			log.debug("getFlvRecordingByExternalUserId :externalUserId: "+externalUserId);
 			
-			String hql = "SELECT c FROM FlvRecording c, Rooms r, Users u " +
+			String hql = "SELECT c FROM FlvRecording c, Room r, User u " +
 					"WHERE c.room_id = r.rooms_id " +
 					"AND c.insertedBy = u.user_id " +
 					"AND u.externalUserId LIKE :externalUserId " +
@@ -130,7 +130,7 @@ public class FlvRecordingDao {
 			
 			log.debug("getFlvRecordingByExternalRoomType :externalRoomType: "+externalRoomType);
 			
-			String hql = "SELECT c FROM FlvRecording c, Rooms r " +
+			String hql = "SELECT c FROM FlvRecording c, Room r " +
 					"WHERE c.room_id = r.rooms_id " +
 					"AND r.externalRoomType LIKE :externalRoomType " +
 					"AND c.insertedBy LIKE :insertedBy " +
@@ -170,7 +170,7 @@ public class FlvRecordingDao {
 			
 			log.debug("getFlvRecordingByExternalRoomType :externalRoomType: "+externalRoomType);
 			
-			String hql = "SELECT c FROM FlvRecording c, Rooms r " +
+			String hql = "SELECT c FROM FlvRecording c, Room r " +
 					"WHERE c.room_id = r.rooms_id " +
 					"AND r.externalRoomType LIKE :externalRoomType " +
 					"AND c.deleted <> :deleted ";

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java Tue Feb  5 02:44:03 2013
@@ -25,7 +25,7 @@ import javax.persistence.TypedQuery;
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
 import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.persistence.beans.adresses.Adresses;
+import org.apache.openmeetings.persistence.beans.user.Address;
 import org.apache.openmeetings.templates.RegisterUserTemplate;
 import org.apache.openmeetings.utils.mail.MailHandler;
 import org.red5.logging.Red5LoggerFactory;
@@ -118,8 +118,8 @@ public class Emailmanagement {
 			if (email.length() == 0)
 				return true;
 			log.debug("checkUserMail: " + email);
-			TypedQuery<Adresses> query = em
-					.createQuery("select c from Adresses as c where c.email LIKE :email AND c.deleted <> :deleted", Adresses.class);
+			TypedQuery<Address> query = em
+					.createQuery("select c from Address as c where c.email LIKE :email AND c.deleted <> :deleted", Address.class);
 			query.setParameter("email", email);
 			query.setParameter("deleted", true);
 			int count = query.getResultList().size();

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java Tue Feb  5 02:44:03 2013
@@ -43,7 +43,7 @@ import org.apache.openmeetings.data.user
 import org.apache.openmeetings.data.user.dao.UsersDao;
 import org.apache.openmeetings.persistence.beans.domain.Organisation;
 import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -243,7 +243,7 @@ public class Organisationmanagement {
 	private boolean checkUserAlreadyStored(Long userIdToAdd, List<?> usersStored)
 			throws Exception {
 		for (Iterator<?> it2 = usersStored.iterator(); it2.hasNext();) {
-			Users us = (Users) it2.next();
+			User us = (User) it2.next();
 			if (us.getUser_id().equals(userIdToAdd)) {
 				log.debug("userIdToAdd found: " + userIdToAdd);
 				return true;
@@ -295,15 +295,15 @@ public class Organisationmanagement {
 				Integer key = (Integer) it.next();
 				Long userIdToAdd = Long.valueOf(users.get(key).toString())
 						.longValue();
-				log.error("userIdToAdd: " + userIdToAdd);
+				log.debug("userIdToAdd: " + userIdToAdd);
 				if (!this.checkUserAlreadyStored(userIdToAdd, usersStored))
 					usersToAdd.add(userIdToAdd);
 			}
 
 			for (Iterator it = usersStored.iterator(); it.hasNext();) {
-				Users us = (Users) it.next();
+				User us = (User) it.next();
 				Long userIdStored = us.getUser_id();
-				log.error("userIdStored: " + userIdStored);
+				log.debug("userIdStored: " + userIdStored);
 				if (!this.checkUserShouldBeStored(userIdStored, users))
 					usersToDel.add(userIdStored);
 			}
@@ -442,7 +442,7 @@ public class Organisationmanagement {
 	
 	public Long addOrganisationUserObj(Long user_id, Organisation_Users orgUser) {
 		try {
-			Users u = usersDao.get(user_id);
+			User u = usersDao.get(user_id);
 			
 			orgUser.setStarttime(new Date());
 			orgUser = em.merge(orgUser);
@@ -486,7 +486,7 @@ public class Organisationmanagement {
 						+ organisation_id);
 				//user should be updated to have recent organisation_users list
 				Long id = null;
-				Users u = usersDao.get(user_id);
+				User u = usersDao.get(user_id);
 				List<Organisation_Users> l = u.getOrganisation_users();
 				for (Organisation_Users ou : l) {
 					if (ou.getOrganisation().getOrganisation_id().equals(organisation_id)) {
@@ -509,13 +509,13 @@ public class Organisationmanagement {
 		return null;
 	}
 
-	public SearchResult<Users> getUsersSearchResultByOrganisationId(
+	public SearchResult<User> getUsersSearchResultByOrganisationId(
 			long organisation_id, int start, int max, String orderby,
 			boolean asc) {
 		try {
 
-			SearchResult<Users> sResult = new SearchResult<Users>();
-			sResult.setObjectName(Users.class.getName());
+			SearchResult<User> sResult = new SearchResult<User>();
+			sResult.setObjectName(User.class.getName());
 			sResult.setRecords(orgUserDao.count(organisation_id));
 			sResult.setResult(getUsersByOrganisationId(organisation_id,
 					start, max, orderby, asc));
@@ -538,12 +538,12 @@ public class Organisationmanagement {
 	 * @param asc
 	 * @return
 	 */
-	public List<Users> getUsersByOrganisationId(long organisation_id, int start,
+	public List<User> getUsersByOrganisationId(long organisation_id, int start,
 			int max, String orderby, boolean asc) {
 		try {
 			String hql =
 				"SELECT c FROM "
-				+ "Users c "
+				+ "User c "
 				+ ", IN(c.organisation_users) ou "
 				+ "WHERE c.deleted = false AND ou.organisation.organisation_id = :organisation_id ";
 			if (orderby.startsWith("c.")) {
@@ -557,12 +557,12 @@ public class Organisationmanagement {
 				hql += " DESC";
 			}
 
-			TypedQuery<Users> q = em.createQuery(hql, Users.class);
+			TypedQuery<User> q = em.createQuery(hql, User.class);
 			q.setParameter("organisation_id", organisation_id);
 			q.setFirstResult(start);
 			q.setMaxResults(max);
 
-			List<Users> userL = q.getResultList();
+			List<User> userL = q.getResultList();
 			return userL;
 		} catch (Exception ex2) {
 			log.error("[getUsersByOrganisationId]", ex2);
@@ -575,13 +575,13 @@ public class Organisationmanagement {
 	 * @param organisation_id
 	 * @return
 	 */
-	public List<Users> getUsersByOrganisationId(long organisation_id) {
+	public List<User> getUsersByOrganisationId(long organisation_id) {
 		try {
 
 			// get all users
-			TypedQuery<Users> q = em.createNamedQuery("getUsersByOrganisationId", Users.class);
+			TypedQuery<User> q = em.createNamedQuery("getUsersByOrganisationId", User.class);
 			q.setParameter("organisation_id", organisation_id);
-			List<Users> userL = q.getResultList();
+			List<User> userL = q.getResultList();
 			Collections.sort(userL, new UsersLoginComparator());
 			return userL;
 
@@ -591,8 +591,8 @@ public class Organisationmanagement {
 		return null;
 	}
 
-	class UsersLoginComparator implements Comparator<Users> {
-		public int compare(Users o1, Users o2) {
+	class UsersLoginComparator implements Comparator<User> {
+		public int compare(User o1, User o2) {
 			if (o1 == null || o2 == null)
 				return 0;
 
@@ -647,7 +647,7 @@ public class Organisationmanagement {
 					"SELECT o FROM Organisation AS o "
 					+ "WHERE o.organisation_id NOT IN ("
 					+ "	SELECT ou.organisation.organisation_id "
-					+ "	FROM Users u, IN(u.organisation_users) ou WHERE u.deleted = false AND u.user_id = :user_id)";
+					+ "	FROM User u, IN(u.organisation_users) ou WHERE u.deleted = false AND u.user_id = :user_id)";
 				TypedQuery<Organisation> q = em.createQuery(qSQL, Organisation.class);
 				q.setParameter("user_id", user_id);
 				q.setFirstResult(start);
@@ -701,7 +701,7 @@ public class Organisationmanagement {
 	 * @return
 	 */
 	//FIXME need to refactor
-	public Long updateUserOrganisationsByUser(Users us, List<Long> organisations) {
+	public Long updateUserOrganisationsByUser(User us, List<Long> organisations) {
 		try {
 			LinkedList<Long> orgIdsToAdd = new LinkedList<Long>();
 			LinkedList<Long> orgIdsToDelete = new LinkedList<Long>();

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java Tue Feb  5 02:44:03 2013
@@ -46,14 +46,14 @@ import org.apache.openmeetings.data.basi
 import org.apache.openmeetings.data.beans.basic.SearchResult;
 import org.apache.openmeetings.data.user.dao.StateDao;
 import org.apache.openmeetings.data.user.dao.UsersDao;
-import org.apache.openmeetings.persistence.beans.adresses.Adresses;
 import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
 import org.apache.openmeetings.persistence.beans.basic.Sessiondata;
 import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.rooms.Client;
+import org.apache.openmeetings.persistence.beans.room.Client;
+import org.apache.openmeetings.persistence.beans.user.Address;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.apache.openmeetings.persistence.beans.user.Userdata;
 import org.apache.openmeetings.persistence.beans.user.Userlevel;
-import org.apache.openmeetings.persistence.beans.user.Users;
 import org.apache.openmeetings.remote.red5.ScopeApplicationAdapter;
 import org.apache.openmeetings.remote.util.SessionVariablesUtil;
 import org.apache.openmeetings.session.ISessionManager;
@@ -123,18 +123,18 @@ public class Usermanagement {
 	 * @param orderby
 	 * @return
 	 */
-	public SearchResult<Users> getUsersList(long user_level, int start, int max,
+	public SearchResult<User> getUsersList(long user_level, int start, int max,
 			String orderby, boolean asc) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
-				SearchResult<Users> sresult = new SearchResult<Users>();
-				sresult.setObjectName(Users.class.getName());
+				SearchResult<User> sresult = new SearchResult<User>();
+				sresult.setObjectName(User.class.getName());
 				sresult.setRecords(usersDao.count());
 
 				// get all users
 				CriteriaBuilder cb = em.getCriteriaBuilder();
-				CriteriaQuery<Users> cq = cb.createQuery(Users.class);
-				Root<Users> c = cq.from(Users.class);
+				CriteriaQuery<User> cq = cb.createQuery(User.class);
+				Root<User> c = cq.from(User.class);
 				Predicate condition = cb.equal(c.get("deleted"), false);
 				cq.where(condition);
 				cq.distinct(asc);
@@ -143,10 +143,10 @@ public class Usermanagement {
 				} else {
 					cq.orderBy(cb.desc(c.get(orderby)));
 				}
-				TypedQuery<Users> q = em.createQuery(cq);
+				TypedQuery<User> q = em.createQuery(cq);
 				q.setFirstResult(start);
 				q.setMaxResults(max);
-				List<Users> ll = q.getResultList();
+				List<User> ll = q.getResultList();
 				sresult.setResult(ll);
 				return sresult;
 			}
@@ -156,11 +156,11 @@ public class Usermanagement {
 		return null;
 	}
 
-	public SearchResult<Users> getAllUserByRange(String search, int start, int max,
+	public SearchResult<User> getAllUserByRange(String search, int start, int max,
 			String orderby, boolean asc) {
 		try {
-			SearchResult<Users> sresult = new SearchResult<Users>();
-			sresult.setObjectName(Users.class.getName());
+			SearchResult<User> sresult = new SearchResult<User>();
+			sresult.setObjectName(User.class.getName());
 			sresult.setRecords(usersDao.count(search));
 
 			String sort = null;
@@ -172,11 +172,11 @@ public class Usermanagement {
 			} else {
 				sort += " DESC ";
 			}
-			String hql = DaoHelper.getSearchQuery("Users", "u", search, true, false, sort, UsersDao.searchFields);
+			String hql = DaoHelper.getSearchQuery("User", "u", search, true, false, sort, UsersDao.searchFields);
 
 			log.debug("Show HQL: " + hql);
 
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createQuery(hql, User.class);
 			// query.setParameter("macomUserId", userId);
 
 			// query
@@ -184,7 +184,7 @@ public class Usermanagement {
 			// else ((Criteria) query).addOrder(Order.desc(orderby));
 			query.setFirstResult(start);
 			query.setMaxResults(max);
-			List<Users> ll = query.getResultList();
+			List<User> ll = query.getResultList();
 
 			sresult.setResult(ll);
 
@@ -203,7 +203,7 @@ public class Usermanagement {
 	 * @param user_id
 	 * @return
 	 */
-	public Users checkAdmingetUserById(long user_level, long user_id) {
+	public User checkAdmingetUserById(long user_level, long user_id) {
 		// FIXME: We have to check here for the User only cause the
 		// Org-Moderator otherwise cannot access it
 		if (authLevelManagement.checkUserLevel(user_level)) {
@@ -212,7 +212,7 @@ public class Usermanagement {
 		return null;
 	}
 
-	public List<Users> getUserByMod(Long user_level, long user_id) {
+	public List<User> getUserByMod(Long user_level, long user_id) {
 		return null;
 	}
 
@@ -229,23 +229,23 @@ public class Usermanagement {
 		try {
 			log.debug("Login user SID : " + SID + " Stored Permanent :"
 					+ storePermanent);
-			String hql = "SELECT c from Users AS c "
+			String hql = "SELECT c from User AS c "
 					+ "WHERE "
 					+ "(c.login LIKE :userOrEmail OR c.adresses.email LIKE :userOrEmail  ) "
 					+ "AND c.deleted <> :deleted";
 
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createQuery(hql, User.class);
 			query.setParameter("userOrEmail", userOrEmail);
 			query.setParameter("deleted", true);
 
-			List<Users> ll = query.getResultList();
+			List<User> ll = query.getResultList();
 
 			log.debug("debug SIZE: " + ll.size());
 
 			if (ll.size() == 0) {
 				return new Long(-10);
 			} else {
-				Users users = ll.get(0);
+				User users = ll.get(0);
 
 				// Refresh User Object
 				users = this.refreshUserObject(users);
@@ -297,7 +297,7 @@ public class Usermanagement {
 		return new Long(-1);
 	}
 
-	public Users refreshUserObject(Users us) {
+	public User refreshUserObject(User us) {
 		try {
 
 			us = em.merge(us);
@@ -308,7 +308,7 @@ public class Usermanagement {
 		return null;
 	}
 
-	public Users loginUserByRemoteHash(String SID, String remoteHash) {
+	public User loginUserByRemoteHash(String SID, String remoteHash) {
 		try {
 
 			Sessiondata sessionData = sessionManagement
@@ -316,7 +316,7 @@ public class Usermanagement {
 
 			if (sessionData != null) {
 
-				Users u = getUserById(sessionData.getUser_id());
+				User u = getUserById(sessionData.getUser_id());
 
 				sessionManagement.updateUserWithoutSession(SID, u.getUser_id());
 
@@ -334,7 +334,7 @@ public class Usermanagement {
 		return new Long(-12);
 	}
 
-	private void updateLastLogin(Users us) {
+	private void updateLastLogin(User us) {
 		try {
 			us.setLastlogin(new Date());
 			if (us.getUser_id() == null) {
@@ -358,13 +358,13 @@ public class Usermanagement {
 	 * @param start
 	 * @return
 	 */
-	public List<Users> searchUser(long user_level, String searchcriteria,
+	public List<User> searchUser(long user_level, String searchcriteria,
 			String searchstring, int max, int start, String orderby, boolean asc) {
 		if (authLevelManagement.checkAdminLevel(user_level)) {
 			try {
 				CriteriaBuilder cb = em.getCriteriaBuilder();
-				CriteriaQuery<Users> cq = cb.createQuery(Users.class);
-				Root<Users> c = cq.from(Users.class);
+				CriteriaQuery<User> cq = cb.createQuery(User.class);
+				Root<User> c = cq.from(User.class);
 				Expression<String> literal = cb.literal("%" + searchstring
 						+ "%");
 				// crit.add(Restrictions.ilike(searchcriteria, "%" +
@@ -379,10 +379,10 @@ public class Usermanagement {
 				} else {
 					cq.orderBy(cb.desc(c.get(orderby)));
 				}
-				TypedQuery<Users> q = em.createQuery(cq);
+				TypedQuery<User> q = em.createQuery(cq);
 				q.setFirstResult(start);
 				q.setMaxResults(max);
-				List<Users> contactsZ = q.getResultList();
+				List<User> contactsZ = q.getResultList();
 				return contactsZ;
 			} catch (Exception ex2) {
 				log.error("searchUser", ex2);
@@ -441,7 +441,7 @@ public class Usermanagement {
 
 		if (authLevelManagement.checkUserLevel(user_level) && user_id != 0) {
 			try {
-				Users us = usersDao.get(user_id);
+				User us = usersDao.get(user_id);
 
 				// Check for duplicates
 				boolean checkName = true;
@@ -613,10 +613,10 @@ public class Usermanagement {
 				return new Long(1);
 			}
 
-			TypedQuery<Users> query = em
-					.createQuery("select c from Users as c where c.user_id = :user_id AND c.deleted <> true", Users.class);
+			TypedQuery<User> query = em
+					.createQuery("select c from User as c where c.user_id = :user_id AND c.deleted <> true", User.class);
 			query.setParameter("user_id", user_id);
-			Users us = null;
+			User us = null;
 			try {
 				us = query.getSingleResult();
 			} catch (NoResultException e) {
@@ -644,10 +644,10 @@ public class Usermanagement {
 				return new Long(1);
 			}
 
-			TypedQuery<Users> query = em
-					.createQuery("select c from Users as c where c.user_id = :user_id AND c.deleted <> true", Users.class);
+			TypedQuery<User> query = em
+					.createQuery("select c from User as c where c.user_id = :user_id AND c.deleted <> true", User.class);
 			query.setParameter("user_id", user_id);
-			Users us = null;
+			User us = null;
 			try {
 				us = query.getSingleResult();
 			} catch (NoResultException e) {
@@ -900,7 +900,7 @@ public class Usermanagement {
 						if (!sendMail.equals("success"))
 							return new Long(-19);
 					}
-					Adresses adr =  new Adresses();
+					Address adr =  new Address();
 					adr.setStreet(street);
 					adr.setZip(zip);
 					adr.setTown(town);
@@ -968,18 +968,18 @@ public class Usermanagement {
 	 * @param language_id
 	 * @param Userpass
 	 *            is MD5-crypted
-	 * @param Adresses adress
+	 * @param Address adress
 	 * @return user_id or error null
 	 */
 	public Long addUser(long level_id, int availible, int status,
 			String firstname, String login, String lastname, long language_id,
-			String userpass, Adresses adress, boolean sendSMS, Date age, String hash,
+			String userpass, Address adress, boolean sendSMS, Date age, String hash,
 			OmTimeZone timezone,
 			Boolean forceTimeZoneCheck, String userOffers, String userSearchs,
 			Boolean showContactData, Boolean showContactDataToContacts, List<Long> orgIds) {
 		try {
 
-			Users users = new Users();
+			User users = new User();
 			users.setFirstname(firstname);
 			users.setLogin(login);
 			users.setLastname(lastname);
@@ -1028,22 +1028,22 @@ public class Usermanagement {
 		return null;
 	}
 
-	public Users getUserByExternalIdAndType(String externalUserId,
+	public User getUserByExternalIdAndType(String externalUserId,
 			String externalUserType) {
 
 		try {
 
-			String hql = "select c from Users as c "
+			String hql = "select c from User as c "
 					+ "where c.externalUserId LIKE :externalUserId "
 					+ "AND c.externalUserType LIKE :externalUserType "
 					+ "AND c.deleted <> :deleted";
 
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createQuery(hql, User.class);
 			query.setParameter("externalUserId", externalUserId);
 			query.setParameter("externalUserType", externalUserType);
 			query.setParameter("deleted", true);
 
-			List<Users> users = query.getResultList();
+			List<User> users = query.getResultList();
 
 			if (users.size() > 0) {
 				return users.get(0);
@@ -1057,12 +1057,12 @@ public class Usermanagement {
 
 	public Long addUserWithExternalKey(long level_id, int availible,
 			int status, String firstname, String login, String lastname,
-			long language_id, boolean emptyPass, String userpass, Adresses address, Date age,
+			long language_id, boolean emptyPass, String userpass, Address address, Date age,
 			String hash, String externalUserId, String externalUserType,
 			boolean generateSipUserData, String email, String jNameTimeZone,
 			String pictureuri) {
 		try {
-			Users users = new Users();
+			User users = new User();
 			users.setFirstname(firstname);
 			users.setLogin(login);
 			users.setLastname(lastname);
@@ -1116,7 +1116,7 @@ public class Usermanagement {
 		return null;
 	}
 
-	public Long addUser(Users usr) {
+	public Long addUser(User usr) {
 		try {
 			em.persist(usr);
 			//em.refresh(usr);
@@ -1162,7 +1162,7 @@ public class Usermanagement {
 				if (user_id != null && user_id > 0) {
 
 					returnLong = user_id;
-					Users savedUser = usersDao.get(user_id);
+					User savedUser = usersDao.get(user_id);
 					savedUser.setAge((Date) values.get("age"));
 					savedUser.setFirstname(values.get("firstname").toString());
 					savedUser.setLastname(values.get("lastname").toString());
@@ -1262,7 +1262,7 @@ public class Usermanagement {
 			// check if Mail given
 			if (email.length() > 0) {
 				// log.debug("getAdresses_id "+addr_e.getAdresses_id());
-				Users us = usersDao.getUserByEmail(email);
+				User us = usersDao.getUserByEmail(email);
 				if (us != null) {
 					this.sendHashByUser(us, appLink);
 					return new Long(-4);
@@ -1270,7 +1270,7 @@ public class Usermanagement {
 					return new Long(-9);
 				}
 			} else if (username.length() > 0) {
-				Users us = usersDao.getUserByName(username);
+				User us = usersDao.getUserByName(username);
 				if (us != null) {
 					this.sendHashByUser(us, appLink);
 					return new Long(-4);
@@ -1285,7 +1285,7 @@ public class Usermanagement {
 		return new Long(-2);
 	}
 
-	private void sendHashByUser(Users us, String appLink) throws Exception {
+	private void sendHashByUser(User us, String appLink) throws Exception {
 		String loginData = us.getLogin() + new Date();
 		log.debug("User: " + us.getLogin());
 		us.setResethash(cryptManager.getInstanceOfCrypt().createPassPhrase(
@@ -1309,20 +1309,20 @@ public class Usermanagement {
 	 * Find User by Id
 	 */
 	// -----------------------------------------------------------------------------------------------------
-	public Users getUserById(Long id) {
+	public User getUserById(Long id) {
 		log.debug("Usermanagement.getUserById");
 
 		if (id == null || id <= 0) {
 			return null;
 		}
 		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Users> cq = cb.createQuery(Users.class);
-		Root<Users> c = cq.from(Users.class);
+		CriteriaQuery<User> cq = cb.createQuery(User.class);
+		Root<User> c = cq.from(User.class);
 		Predicate condition = cb.equal(c.get("deleted"), false);
 		Predicate subCondition = cb.equal(c.get("user_id"), id);
 		cq.where(condition, subCondition);
-		TypedQuery<Users> q = em.createQuery(cq);
-		Users u = null;
+		TypedQuery<User> q = em.createQuery(cq);
+		User u = null;
 		try {
 			u = q.getSingleResult();
 		} catch (NoResultException e) {
@@ -1333,16 +1333,16 @@ public class Usermanagement {
 		return u;
 	}
 
-	public Users getUserByIdAndDeleted(Long id) throws Exception {
+	public User getUserByIdAndDeleted(Long id) throws Exception {
 		log.debug("Usermanagement.getUserById");
 
 		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Users> cq = cb.createQuery(Users.class);
-		Root<Users> c = cq.from(Users.class);
+		CriteriaQuery<User> cq = cb.createQuery(User.class);
+		Root<User> c = cq.from(User.class);
 		Predicate condition = cb.equal(c.get("user_id"), id);
 		cq.where(condition);
-		TypedQuery<Users> q = em.createQuery(cq);
-		Users u = null;
+		TypedQuery<User> q = em.createQuery(cq);
+		User u = null;
 		try {
 			u = q.getSingleResult();
 		} catch (NoResultException e) {
@@ -1360,17 +1360,17 @@ public class Usermanagement {
 	 *         user with login - name
 	 */
 	// -----------------------------------------------------------------------------------------------------
-	public Users getUserByLogin(String login) throws Exception {
+	public User getUserByLogin(String login) throws Exception {
 		log.debug("Usermanagement.getUserByLogin : " + login);
 
 		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Users> cq = cb.createQuery(Users.class);
-		Root<Users> c = cq.from(Users.class);
+		CriteriaQuery<User> cq = cb.createQuery(User.class);
+		Root<User> c = cq.from(User.class);
 		Predicate condition = cb.equal(c.get("deleted"), false);
 		Predicate subCondition = cb.equal(c.get("login"), login);
 		cq.where(condition, subCondition);
-		TypedQuery<Users> q = em.createQuery(cq);
-		Users u = null;
+		TypedQuery<User> q = em.createQuery(cq);
+		User u = null;
 		try {
 			u = q.getSingleResult();
 		} catch (NoResultException e) {
@@ -1388,19 +1388,19 @@ public class Usermanagement {
 	 *         active user with login - name
 	 */
 	// -----------------------------------------------------------------------------------------------------
-	public Users getUserByLoginOrEmail(String userOrEmail) throws Exception {
+	public User getUserByLoginOrEmail(String userOrEmail) throws Exception {
 		// log.debug("Usermanagement.getUserByLoginOrEmail : " + userOrEmail);
 
-		String hql = "SELECT c from Users AS c "
+		String hql = "SELECT c from User AS c "
 				+ "WHERE "
 				+ "(c.login LIKE :userOrEmail OR c.adresses.email LIKE :userOrEmail  ) "
 				+ "AND c.externalUserId IS NULL " + "AND c.deleted <> :deleted";
 
-		TypedQuery<Users> query = em.createQuery(hql, Users.class);
+		TypedQuery<User> query = em.createQuery(hql, User.class);
 		query.setParameter("userOrEmail", userOrEmail);
 		query.setParameter("deleted", true);
 
-		List<Users> ll = query.getResultList();
+		List<User> ll = query.getResultList();
 
 		if (ll.size() > 1) {
 			log.error("ALERT :: There are two users in the database that have either same login or Email ");
@@ -1415,16 +1415,16 @@ public class Usermanagement {
 
 	}
 
-	public Users getUserByEmail(String userOrEmail) throws Exception {
+	public User getUserByEmail(String userOrEmail) throws Exception {
 		log.debug("Usermanagement.getUserByEmail : " + userOrEmail);
 
-		String hql = "SELECT c from Users AS c " + "WHERE "
+		String hql = "SELECT c from User AS c " + "WHERE "
 				+ "c.adresses.email LIKE :userOrEmail";
 
-		TypedQuery<Users> query = em.createQuery(hql, Users.class);
+		TypedQuery<User> query = em.createQuery(hql, User.class);
 		query.setParameter("userOrEmail", userOrEmail);
 
-		List<Users> ll = query.getResultList();
+		List<User> ll = query.getResultList();
 
 		if (ll.size() > 1) {
 			log.error("ALERT :: There are two users in the database that have same Email ");
@@ -1526,15 +1526,15 @@ public class Usermanagement {
 	 * @param hash
 	 * @return
 	 */
-	public Users getUserByActivationHash(String hash) {
+	public User getUserByActivationHash(String hash) {
 		try {
-			String hql = "SELECT u FROM Users as u "
+			String hql = "SELECT u FROM User as u "
 					+ " where u.activatehash = :activatehash"
 					+ " AND u.deleted <> :deleted";
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createQuery(hql, User.class);
 			query.setParameter("activatehash", hash);
 			query.setParameter("deleted", true);
-			Users u = null;
+			User u = null;
 			try {
 				u = query.getSingleResult();
 			} catch (NoResultException e) {
@@ -1548,7 +1548,7 @@ public class Usermanagement {
 
 	}
 
-	public void updateUser(Users user) {
+	public void updateUser(User user) {
 		usersDao.update(user, 1L);
 	}
 
@@ -1561,12 +1561,12 @@ public class Usermanagement {
 	 * @param search
 	 * @return
 	 */
-	public SearchResult<Users> getUsersListWithSearch(Long user_level, int start,
+	public SearchResult<User> getUsersListWithSearch(Long user_level, int start,
 			int max, String orderby, boolean asc, String search) {
 		try {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
 
-				String hql = "select c from Users c "
+				String hql = "select c from User c "
 						+ "where c.deleted = false " + "AND ("
 						+ "lower(c.login) LIKE :search "
 						+ "OR lower(c.firstname) LIKE :search "
@@ -1591,13 +1591,13 @@ public class Usermanagement {
 				}
 				log.debug("getUsersList search: " + search);
 
-				SearchResult<Users> sresult = new SearchResult<Users>();
-				sresult.setObjectName(Users.class.getName());
+				SearchResult<User> sresult = new SearchResult<User>();
+				sresult.setObjectName(User.class.getName());
 				sresult.setRecords(usersDao
 						.selectMaxFromUsersWithSearch(search));
 
 				// get all users
-				TypedQuery<Users> query = em.createQuery(hql, Users.class);
+				TypedQuery<User> query = em.createQuery(hql, User.class);
 				query.setParameter("search", StringUtils.lowerCase(search));
 				query.setMaxResults(max);
 				query.setFirstResult(start);
@@ -1612,11 +1612,11 @@ public class Usermanagement {
 		return null;
 	}
 
-	public List<Users> searchUserProfile(String searchTxt, String userOffers,
+	public List<User> searchUserProfile(String searchTxt, String userOffers,
 			String userSearchs, String orderBy, int start, int max, boolean asc) {
 		try {
 
-			String hql = "select c from Users c "
+			String hql = "select c from User c "
 					+ "where c.deleted = false ";
 
 			if (searchTxt.length() != 0 && userOffers.length() != 0
@@ -1701,7 +1701,7 @@ public class Usermanagement {
 			log.debug("hql :: " + hql);
 
 			// get all users
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createQuery(hql, User.class);
 
 			if (searchTxt.length() != 0 && userOffers.length() != 0
 					&& userSearchs.length() != 0) {
@@ -1750,7 +1750,7 @@ public class Usermanagement {
 			query.setMaxResults(max);
 			query.setFirstResult(start);
 
-			List<Users> userList = query.getResultList();
+			List<User> userList = query.getResultList();
 
 			return userList;
 
@@ -1765,7 +1765,7 @@ public class Usermanagement {
 			String userSearchs) {
 		try {
 
-			String hql = "select count(c.user_id) from Users c "
+			String hql = "select count(c.user_id) from User c "
 					+ "where c.deleted = false ";
 
 			if (searchTxt.length() != 0 && userOffers.length() != 0
@@ -1903,7 +1903,7 @@ public class Usermanagement {
 			String userSearchs) {
 		try {
 
-			String hql = "select count(c.user_id) from Users c "
+			String hql = "select count(c.user_id) from User c "
 					+ "where c.deleted = false " + "AND " + "(" + "("
 					+ "lower(c.login) LIKE :search "
 					+ "OR lower(c.firstname) LIKE :search "

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationUserDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationUserDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationUserDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationUserDao.java Tue Feb  5 02:44:03 2013
@@ -26,7 +26,7 @@ import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.data.IDataProviderDao;
 import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.apache.openmeetings.utils.DaoHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -104,7 +104,7 @@ public class OrganisationUserDao impleme
 
 	public void delete(Organisation_Users entity, long userId) {
 		if (entity.getOrganisation_users_id() != null) {
-			Users u = usersDao.get(entity.getUser_id());
+			User u = usersDao.get(entity.getUser_id());
 			int idx = u.getOrganisation_users().indexOf(entity);
 			//entity has been detached need to re-fetch
 			Organisation_Users ou = u.getOrganisation_users().remove(idx);



Mime
View raw message