openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebawag...@apache.org
Subject svn commit: r1442455 [3/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/user/dao/PrivateMessagesDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/PrivateMessagesDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/PrivateMessagesDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/PrivateMessagesDao.java Tue Feb  5 02:44:03 2013
@@ -29,9 +29,9 @@ import javax.persistence.TypedQuery;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.user.PrivateMessages;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.user.PrivateMessage;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.transaction.annotation.Transactional;
@@ -44,10 +44,10 @@ public class PrivateMessagesDao {
 	private EntityManager em;
 	
 	public Long addPrivateMessage(String subject, String message, Long parentMessageId, 
-			Users from, Users to, Users owner, Boolean bookedRoom, Rooms room,
+			User from, User to, User owner, Boolean bookedRoom, Room room,
 			Boolean isContactRequest, Long userContactId, String email) {
 		try {
-			PrivateMessages privateMessage = new PrivateMessages();
+			PrivateMessage privateMessage = new PrivateMessage();
 			privateMessage.setInserted(new Date());
 			privateMessage.setSubject(subject);
 			privateMessage.setMessage(message);
@@ -74,7 +74,7 @@ public class PrivateMessagesDao {
 		return null;
 	}
 	
-	public Long addPrivateMessageObj(PrivateMessages privateMessage) {
+	public Long addPrivateMessageObj(PrivateMessage privateMessage) {
 		try {
 			
 			privateMessage = em.merge(privateMessage);
@@ -87,47 +87,33 @@ public class PrivateMessagesDao {
 		return null;
 	}
 	
-	public List<PrivateMessages> getPrivateMessages() {
+	public List<PrivateMessage> getPrivateMessages() {
 		try {
-			
-			String hql = "select c from PrivateMessages c ";
-			
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
-			
-			List<PrivateMessages> privateMessages = query.getResultList();
-			
-			return privateMessages;
-			
+			TypedQuery<PrivateMessage> query = em.createNamedQuery("getPrivateMessages", PrivateMessage.class); 
+			return query.getResultList();
 		} catch (Exception e) {
 			log.error("[getPrivateMessages]",e);
 		}
 		return null;
 	}
 	
-	public PrivateMessages getPrivateMessagesById(Long privateMessageId) {
+	public PrivateMessage getPrivateMessagesById(Long privateMessageId) {
 		try {
-			
-			String hql = "select c from PrivateMessages c " +
-						"where c.privateMessageId = :privateMessageId ";
-			
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
+			TypedQuery<PrivateMessage> query = em.createNamedQuery("getPrivateMessagesById", PrivateMessage.class); 
 			query.setParameter("privateMessageId", privateMessageId);
-			
-			PrivateMessages privateMessage = null;
+			PrivateMessage privateMessage = null;
 			try {
 				privateMessage = query.getSingleResult();
 		    } catch (NoResultException ex) {
 		    }
-			
 			return privateMessage;
-			
 		} catch (Exception e) {
 			log.error("[countPrivateMessagesByUser]",e);
 		}
 		return null;
 	}
 	
-	public void updatePrivateMessages(PrivateMessages privateMessage) {
+	public void updatePrivateMessages(PrivateMessage privateMessage) {
 		try {
 			
 			if (privateMessage.getPrivateMessageFolderId() == null) {
@@ -146,7 +132,7 @@ public class PrivateMessagesDao {
 	public Long countPrivateMessagesByUser(Long toUserId, String search, Long privateMessageFolderId) {
 		try {
 			
-			String hql = "select count(c.privateMessageId) from PrivateMessages c " +
+			String hql = "select count(c.privateMessageId) from PrivateMessage c " +
 						"where c.to.user_id = :toUserId " +
 						"AND c.isTrash = false " +
 						"AND c.owner.user_id = :toUserId " +
@@ -181,32 +167,23 @@ public class PrivateMessagesDao {
 	
 	public Long getNumberMessages(Long toUserId, Long privateMessageFolderId, boolean isRead) {
 		try {
-			
-			String hql = "select COUNT(c.privateMessageId) from PrivateMessages c " +
-						"where c.to.user_id = :toUserId " +
-						"AND c.isTrash = :isTrash " +
-						"AND c.owner.user_id = :toUserId " +
-						"AND c.isRead = :isRead " +
-						"AND c.privateMessageFolderId = :privateMessageFolderId ";
-
-			TypedQuery<Long> query = em.createQuery(hql, Long.class); 
+			TypedQuery<Long> query = em.createNamedQuery("getNumberMessages", Long.class); 
 			query.setParameter("toUserId", toUserId);
 			query.setParameter("isTrash", false);
 			query.setParameter("isRead", false);
 			query.setParameter("privateMessageFolderId", privateMessageFolderId);
 			return query.getSingleResult();
-			
 		} catch (Exception e) {
 			log.error("[getNumberMessages]",e);
 		}
 		return null;
 	}
 	
-	public List<PrivateMessages> getPrivateMessagesByUser(Long toUserId, String search,
+	public List<PrivateMessage> getPrivateMessagesByUser(Long toUserId, String search,
 			String orderBy, int start, Boolean asc, Long privateMessageFolderId, int max) {
 		try {
 			
-			String hql = "select c from PrivateMessages c " +
+			String hql = "select c from PrivateMessage c " +
 						"where c.to.user_id = :toUserId " +
 						"AND c.isTrash = :isTrash " +
 						"AND c.owner.user_id = :toUserId " +
@@ -231,7 +208,7 @@ public class PrivateMessagesDao {
 				hql += " DESC";
 			}
 
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
+			TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class); 
 			query.setParameter("toUserId", toUserId);
 			query.setParameter("isTrash", false);
 			query.setParameter("privateMessageFolderId", privateMessageFolderId);
@@ -240,7 +217,7 @@ public class PrivateMessagesDao {
 			}
 			query.setFirstResult(start);
 			query.setMaxResults(max);
-			List<PrivateMessages> ll = query.getResultList();
+			List<PrivateMessage> ll = query.getResultList();
 			
 			return ll;	
 		} catch (Exception e) {
@@ -253,7 +230,7 @@ public class PrivateMessagesDao {
 			Long privateMessageFolderId) {
 		try {
 			
-			String hql = "select count(c.privateMessageId) from PrivateMessages c " +
+			String hql = "select count(c.privateMessageId) from PrivateMessage c " +
 						"where c.from.user_id = :toUserId " +
 						"AND c.isTrash = :isTrash " +
 						"AND c.owner.user_id = :toUserId " +
@@ -287,11 +264,11 @@ public class PrivateMessagesDao {
 		return null;
 	}
 	
-	public List<PrivateMessages> getTrashPrivateMessagesByUser(Long user_id, String search, 
+	public List<PrivateMessage> getTrashPrivateMessagesByUser(Long user_id, String search, 
 			String orderBy, int start, Boolean asc, int max) {
 		try {
 			
-			String hql = "select c from PrivateMessages c " +
+			String hql = "select c from PrivateMessage c " +
 						"where c.isTrash = true " +
 						"AND c.owner.user_id = :user_id ";
 			
@@ -314,14 +291,14 @@ public class PrivateMessagesDao {
 				hql += " DESC";
 			}
 
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
+			TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class); 
 			if (search.length() != 0) {
 				query.setParameter("search", StringUtils.lowerCase("%"+search+"%"));
 			}
 			query.setParameter("user_id", user_id);
 			query.setFirstResult(start);
 			query.setMaxResults(max);
-			List<PrivateMessages> ll = query.getResultList();
+			List<PrivateMessage> ll = query.getResultList();
 			
 			return ll;	
 		} catch (Exception e) {
@@ -333,7 +310,7 @@ public class PrivateMessagesDao {
 	public Long countTrashPrivateMessagesByUser(Long user_id, String search) {
 		try {
 			
-			String hql = "select count(c.privateMessageId) from PrivateMessages c " +
+			String hql = "select count(c.privateMessageId) from PrivateMessage c " +
 						"where c.isTrash = true  " +
 						"AND c.owner.user_id = :user_id ";
 			
@@ -363,11 +340,11 @@ public class PrivateMessagesDao {
 		return null;
 	}
 	
-	public List<PrivateMessages> getSendPrivateMessagesByUser(Long toUserId, String search, 
+	public List<PrivateMessage> getSendPrivateMessagesByUser(Long toUserId, String search, 
 			String orderBy, int start, Boolean asc, Long privateMessageFolderId, int max) {
 		try {
 			
-			String hql = "select c from PrivateMessages c " +
+			String hql = "select c from PrivateMessage c " +
 						"where c.from.user_id = :toUserId " +
 						"AND c.isTrash = false " +
 						"AND c.owner.user_id = :toUserId " +
@@ -392,7 +369,7 @@ public class PrivateMessagesDao {
 				hql += " DESC";
 			}
 
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
+			TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class); 
 			query.setParameter("toUserId", toUserId);
 			query.setParameter("privateMessageFolderId", privateMessageFolderId);
 			if (search.length() != 0) {
@@ -400,7 +377,7 @@ public class PrivateMessagesDao {
 			}
 			query.setFirstResult(start);
 			query.setMaxResults(max);
-			List<PrivateMessages> ll = query.getResultList();
+			List<PrivateMessage> ll = query.getResultList();
 			
 			return ll;	
 		} catch (Exception e) {
@@ -413,7 +390,7 @@ public class PrivateMessagesDao {
 	public Long countFolderPrivateMessagesByUser(Long toUserId, Long privateMessageFolderId, String search) {
 		try {
 			
-			String hql = "select count(c.privateMessageId) from PrivateMessages c " +
+			String hql = "select count(c.privateMessageId) from PrivateMessage c " +
 						"where c.isTrash = false " +
 						"AND c.owner.user_id = :toUserId " +
 						"AND c.privateMessageFolderId = :privateMessageFolderId ";
@@ -445,11 +422,11 @@ public class PrivateMessagesDao {
 		return null;
 	}
 	
-	public List<PrivateMessages> getFolderPrivateMessagesByUser(Long toUserId, String search, String orderBy, 
+	public List<PrivateMessage> getFolderPrivateMessagesByUser(Long toUserId, String search, String orderBy, 
 			int start, Boolean asc, Long privateMessageFolderId, int max) {
 		try {
 			
-			String hql = "select c from PrivateMessages c " +
+			String hql = "select c from PrivateMessage c " +
 							"where c.isTrash = :isTrash " +
 							"AND c.owner.user_id = :toUserId " +
 							"AND c.privateMessageFolderId = :privateMessageFolderId ";
@@ -477,7 +454,7 @@ public class PrivateMessagesDao {
 			
 			log.debug("privateMessageFolderId "+privateMessageFolderId);
 			
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
+			TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class); 
 			query.setParameter("toUserId", toUserId);
 			query.setParameter("isTrash", false);
 			query.setParameter("privateMessageFolderId", privateMessageFolderId);
@@ -486,7 +463,7 @@ public class PrivateMessagesDao {
 			}
 			query.setFirstResult(start);
 			query.setMaxResults(max);
-			List<PrivateMessages> ll = query.getResultList();
+			List<PrivateMessage> ll = query.getResultList();
 			
 			return ll;
 			
@@ -498,12 +475,7 @@ public class PrivateMessagesDao {
 
 	public int updatePrivateMessagesToTrash(List<Long> privateMessageIds, Boolean isTrash, Long privateMessageFolderId) {
 		try {
-			
-			String hql = "UPDATE PrivateMessages c " +
-						"SET c.isTrash = :isTrash,c.privateMessageFolderId = :privateMessageFolderId " +
-						"where c.privateMessageId IN (:privateMessageIds) ";
-			
-			Query query = em.createQuery(hql); 
+			Query query = em.createNamedQuery("updatePrivateMessagesToTrash"); 
 			query.setParameter("isTrash", isTrash);
 			query.setParameter("privateMessageFolderId", privateMessageFolderId);
 			query.setParameter("privateMessageIds", privateMessageIds);
@@ -512,12 +484,8 @@ public class PrivateMessagesDao {
 			//Refresh the Entities in the Cache as Hibernate will not do it!
 			//FIXME weird code
 			for (Long privateMessageId : privateMessageIds) {
-				String hqlSel = "select c from PrivateMessages c " +
-								"where c.privateMessageId = :privateMessageId ";
-	
-				TypedQuery<PrivateMessages> querySel = em.createQuery(hqlSel, PrivateMessages.class); 
+				TypedQuery<PrivateMessage> querySel = em.createNamedQuery("getPrivateMessagesById", PrivateMessage.class); 
 				querySel.setParameter("privateMessageId", privateMessageId);
-				
 				try {
 					querySel.getSingleResult();
 			    } catch (NoResultException ex) {
@@ -533,12 +501,7 @@ public class PrivateMessagesDao {
 	
 	public int updatePrivateMessagesReadStatus(List<Long> privateMessageIds, Boolean isRead) {
 		try {
-			
-			String hql = "UPDATE PrivateMessages c " +
-						"SET c.isRead = :isRead " +
-						"where c.privateMessageId IN (:privateMessageIds) ";
-			
-			Query query = em.createQuery(hql); 
+			Query query = em.createNamedQuery("updatePrivateMessagesReadStatus"); 
 			query.setParameter("isRead", isRead);
 			query.setParameter("privateMessageIds", privateMessageIds);
 			int updatedEntities = query.executeUpdate();
@@ -546,12 +509,8 @@ public class PrivateMessagesDao {
 			//Refresh the Entities in the Cache as Hibernate will not do it!
 			//FIXME weird code
 			for (Long privateMessageId : privateMessageIds) {
-				String hqlSel = "select c from PrivateMessages c " +
-								"where c.privateMessageId = :privateMessageId ";
-	
-				TypedQuery<PrivateMessages> querySel = em.createQuery(hqlSel, PrivateMessages.class); 
+				TypedQuery<PrivateMessage> querySel = em.createNamedQuery("getPrivateMessagesById", PrivateMessage.class); 
 				querySel.setParameter("privateMessageId", privateMessageId);
-				
 				try {
 					querySel.getSingleResult();
 			    } catch (NoResultException ex) {
@@ -566,12 +525,7 @@ public class PrivateMessagesDao {
 
 	public Integer moveMailsToFolder(List<Long> privateMessageIds, Long privateMessageFolderId) {
 		try {
-			
-			String hql = "UPDATE PrivateMessages c " +
-						"SET c.privateMessageFolderId = :privateMessageFolderId, c.isTrash = false " +
-						"where c.privateMessageId IN (:privateMessageIds) ";
-			
-			Query query = em.createQuery(hql); 
+			Query query = em.createNamedQuery("moveMailsToFolder"); 
 			query.setParameter("privateMessageFolderId", privateMessageFolderId);
 			query.setParameter("privateMessageIds", privateMessageIds);
 			int updatedEntities = query.executeUpdate();
@@ -579,12 +533,8 @@ public class PrivateMessagesDao {
 			//Refresh the Entities in the Cache as Hibernate will not do it!
 			//FIXME weird code
 			for (Long privateMessageId : privateMessageIds) {
-				String hqlSel = "select c from PrivateMessages c " +
-								"where c.privateMessageId = :privateMessageId ";
-	
-				TypedQuery<PrivateMessages> querySel = em.createQuery(hqlSel, PrivateMessages.class); 
+				TypedQuery<PrivateMessage> querySel = em.createNamedQuery("getPrivateMessagesById", PrivateMessage.class); 
 				querySel.setParameter("privateMessageId", privateMessageId);
-				
 				try {
 					querySel.getSingleResult();
 			    } catch (NoResultException ex) {
@@ -599,33 +549,20 @@ public class PrivateMessagesDao {
 	
 	public int deletePrivateMessages(List<Long> privateMessageIds) {
 		try {
-			
-			String hql = "DELETE FROM PrivateMessages c " +
-						"where c.privateMessageId IN (:privateMessageIds) ";
-			
-			Query query = em.createQuery(hql); 
+			Query query = em.createNamedQuery("deletePrivateMessages"); 
 			query.setParameter("privateMessageIds", privateMessageIds);
-			int updatedEntities = query.executeUpdate();
-			
-			return updatedEntities;
+			return query.executeUpdate();
 		} catch (Exception e) {
-			log.error("[updatePrivateMessagesReadStatus]",e);
+			log.error("[deletePrivateMessages]",e);
 		}
 		return -1;
 	}
 	
-	public List<PrivateMessages> getPrivateMessagesByRoom(Long roomId) {
+	public List<PrivateMessage> getPrivateMessagesByRoom(Long roomId) {
 		try {
-			
-			String hql = "select c from PrivateMessages c " +
-						"where c.room.rooms_id = :roomId ";
-			
-			
-			TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class); 
+			TypedQuery<PrivateMessage> query = em.createNamedQuery("getPrivateMessagesByRoom", PrivateMessage.class); 
 			query.setParameter("roomId", roomId);
-			List<PrivateMessages> ll = query.getResultList();
-			
-			return ll;	
+			return query.getResultList();
 		} catch (Exception e) {
 			log.error("[getPrivateMessagesByRoom]",e);
 		}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/SalutationDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/SalutationDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/SalutationDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/SalutationDao.java Tue Feb  5 02:44:03 2013
@@ -30,7 +30,7 @@ import javax.persistence.criteria.Root;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
-import org.apache.openmeetings.persistence.beans.user.Salutations;
+import org.apache.openmeetings.persistence.beans.user.Salutation;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -61,7 +61,7 @@ public class SalutationDao {
 	 */
 	public Long addUserSalutation(String titelname, long fieldvalues_id) {
 		try {
-			Salutations ti = new Salutations();
+			Salutation ti = new Salutation();
 			ti.setName(titelname);
 			ti.setDeleted(false);
 			ti.setFieldvalues_id(fieldvalues_id);
@@ -81,15 +81,15 @@ public class SalutationDao {
 	 * @param user_level
 	 * @return
 	 */
-	public List<Salutations> getUserSalutations(long language_id) {
+	public List<Salutation> getUserSalutations(long language_id) {
 		try {
 			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Salutations> cq = cb.createQuery(Salutations.class);
-			Root<Salutations> from = cq.from(Salutations.class);
-			CriteriaQuery<Salutations> select = cq.select(from);
-			TypedQuery<Salutations> q = em.createQuery(select);
-			List<Salutations> ll = q.getResultList();
-			for (Salutations ti : ll) {
+			CriteriaQuery<Salutation> cq = cb.createQuery(Salutation.class);
+			Root<Salutation> from = cq.from(Salutation.class);
+			CriteriaQuery<Salutation> select = cq.select(from);
+			TypedQuery<Salutation> q = em.createQuery(select);
+			List<Salutation> ll = q.getResultList();
+			for (Salutation ti : ll) {
 				ti.setLabel(fieldmanagment.getFieldByIdAndLanguage(
 						ti.getFieldvalues_id(), language_id));
 			}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/StateDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/StateDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/StateDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/StateDao.java Tue Feb  5 02:44:03 2013
@@ -26,15 +26,15 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.persistence.beans.adresses.States;
+import org.apache.openmeetings.persistence.beans.user.State;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
- * CRUD operations for {@link States}
+ * CRUD operations for {@link State}
  * 
- * @author swagner
+ * @author sebawagner
  * 
  */
 @Transactional
@@ -66,7 +66,7 @@ public class StateDao {
 	public Long addState(String name, String shortName, int code) {
 		try {
 
-			States st = new States();
+			State st = new State();
 			st.setName(name);
 			st.setShortName(shortName);
 			st.setCode(code);
@@ -91,13 +91,13 @@ public class StateDao {
 	 * @param state_id
 	 * @return the state-object or null
 	 */
-	public States getStateById(long state_id) {
+	public State getStateById(long state_id) {
 		try {
-			TypedQuery<States> query = em
-					.createQuery("select c from States as c where c.state_id = :state_id AND c.deleted <> :deleted", States.class);
+			TypedQuery<State> query = em
+					.createNamedQuery("getStateById", State.class);
 			query.setParameter("state_id", state_id);
 			query.setParameter("deleted", true);
-			List<States> ll = query.getResultList();
+			List<State> ll = query.getResultList();
 			if (ll.size() > 0) {
 				return ll.get(0);
 			}
@@ -112,12 +112,12 @@ public class StateDao {
 	 * 
 	 * @return List of State Objects or null
 	 */
-	public List<States> getStates() {
+	public List<State> getStates() {
 		try {
-			TypedQuery<States> query = em
-					.createQuery("select c from States as c where c.deleted <> :deleted", States.class);
+			TypedQuery<State> query = em
+					.createNamedQuery("getStates", State.class);
 			query.setParameter("deleted", true);
-			List<States> ll = query.getResultList();
+			List<State> ll = query.getResultList();
 			return ll;
 		} catch (Exception ex2) {
 			log.error("getStates", ex2);

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UserContactsDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UserContactsDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UserContactsDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UserContactsDao.java Tue Feb  5 02:44:03 2013
@@ -29,7 +29,7 @@ import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.user.Usermanagement;
-import org.apache.openmeetings.persistence.beans.user.UserContacts;
+import org.apache.openmeetings.persistence.beans.user.UserContact;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,7 +47,7 @@ public class UserContactsDao {
 	public Long addUserContact(Long user_id, Long ownerId, Boolean pending, String hash) {
 		try {
 			
-			UserContacts userContact = new UserContacts();
+			UserContact userContact = new UserContact();
 			userContact.setInserted(new Date());
 			userContact.setOwner(userManagement.getUserById(ownerId));
 			userContact.setContact(userManagement.getUserById(user_id));
@@ -64,7 +64,7 @@ public class UserContactsDao {
 		return null;
 	}
 	
-	public Long addUserContactObj(UserContacts userContact) {
+	public Long addUserContactObj(UserContact userContact) {
 		try {
 			
 			userContact.setInserted(new Date());
@@ -79,32 +79,30 @@ public class UserContactsDao {
 		return null;
 	}
 	
+	/**
+	 * @param userContactDeleteId
+	 * @return rowcount of update
+	 */
 	public Integer deleteUserContact(Long userContactDeleteId) {
 		try {
-			
-			String hql = "delete from UserContacts u where u.userContactId = :userContactDeleteId";
-			
-			Query query = em.createQuery(hql);
+			Query query = em.createNamedQuery("deleteUserContact");
 			query.setParameter("userContactDeleteId", userContactDeleteId);
-	        int rowCount = query.executeUpdate();
-			
-			return rowCount;			
+	        return query.executeUpdate();
 		} catch (Exception e) {
 			log.error("[deleteUserContact]",e);
 		}
 		return null;
 	}
 	
+	/**
+	 * @param ownerId
+	 * @return rowcount of update
+	 */
 	public Integer deleteAllUserContacts(Long ownerId) {
 		try {
-			
-			String hql = "delete from UserContacts u where u.owner.user_id = :ownerId";
-			
-			Query query = em.createQuery(hql);
+			Query query = em.createNamedQuery("deleteAllUserContacts");
 	        query.setParameter("ownerId",ownerId);
-	        int rowCount = query.executeUpdate();
-			
-			return rowCount;			
+	        return query.executeUpdate();
 		} catch (Exception e) {
 			log.error("[deleteAllUserContacts]",e);
 		}
@@ -113,11 +111,7 @@ public class UserContactsDao {
 	
 	public Long checkUserContacts(Long user_id, Long ownerId) {
 		try {
-			
-			String hql = "select count(c.userContactId) from UserContacts c " +
-							"where c.contact.user_id = :user_id AND c.owner.user_id = :ownerId ";
-			
-			TypedQuery<Long> query = em.createQuery(hql, Long.class); 
+			TypedQuery<Long> query = em.createNamedQuery("checkUserContacts", Long.class); 
 			query.setParameter("user_id", user_id);
 			query.setParameter("ownerId", ownerId);
 			List<Long> ll = query.getResultList();
@@ -132,149 +126,94 @@ public class UserContactsDao {
 		return null;
 	}
 	
-	public UserContacts getContactsByHash(String hash) {
+	public UserContact getContactsByHash(String hash) {
 		try {
-			
-			String hql = "select c from UserContacts c " +
-							"where c.hash like :hash ";
-			
-			TypedQuery<UserContacts> query = em.createQuery(hql, UserContacts.class); 
+			TypedQuery<UserContact> query = em.createNamedQuery("getContactsByHash", UserContact.class); 
 			query.setParameter("hash", hash);
-			List<UserContacts> ll = query.getResultList();
-			
+			List<UserContact> ll = query.getResultList();
 			if (ll.size() > 0) {
 				return ll.get(0);
 			}
-			
-			
 		} catch (Exception e) {
 			log.error("[getContactsByHash]",e);
 		}
 		return null;
 	}
 	
-	public List<UserContacts> getContactsByUserAndStatus(Long ownerId, Boolean pending) {
+	public List<UserContact> getContactsByUserAndStatus(Long ownerId, Boolean pending) {
 		try {
-			
-			String hql = "select c from UserContacts c " +
-							"where c.owner.user_id = :ownerId " +
-							"AND c.pending = :pending " +
-							"AND c.contact.deleted <> true";
-			
-			TypedQuery<UserContacts> query = em.createQuery(hql, UserContacts.class);
+			TypedQuery<UserContact> query = em.createNamedQuery("getContactsByUserAndStatus", UserContact.class);
 			query.setParameter("ownerId", ownerId);
 			query.setParameter("pending", pending);
-			List<UserContacts> ll = query.getResultList();
-			
-			return ll;
-			
+			return query.getResultList();
 		} catch (Exception e) {
 			log.error("[getContactsByUserAndStatus]",e);
 		}
 		return null;
 	}
 	
-	public UserContacts getUserContactByShareCalendar(Long contactId,
+	public UserContact getUserContactByShareCalendar(Long contactId,
 			Boolean shareCalendar, Long userId) {
 		try {
-
-			String hql = "select c from UserContacts c "
-					+ "where c.contact.user_id = :userId "
-					+ "AND c.owner.user_id = :contactId "
-					+ "AND c.shareCalendar = :shareCalendar "
-					+ "AND c.contact.deleted <> true";
-
-			TypedQuery<UserContacts> query = em.createQuery(hql,
-					UserContacts.class);
+			TypedQuery<UserContact> query = em.createNamedQuery("getUserContactByShareCalendar",
+					UserContact.class);
 			query.setParameter("contactId", contactId);
 			query.setParameter("userId", userId);
 			query.setParameter("shareCalendar", shareCalendar);
-			List<UserContacts> ll = query.getResultList();
-
+			List<UserContact> ll = query.getResultList();
 			if (ll.size() > 0) {
 				return ll.get(0);
 			}
-
 		} catch (Exception e) {
 			log.error("[getUserContactByShareCalendar]", e);
 		}
 		return null;
 	}
 
-	public List<UserContacts> getContactsByShareCalendar(Long contactId, Boolean shareCalendar) {
+	public List<UserContact> getContactsByShareCalendar(Long contactId, Boolean shareCalendar) {
 		try {
-			
-			String hql = "select c from UserContacts c " +
-							"where c.contact.user_id = :contactId " +
-							"AND c.shareCalendar = :shareCalendar " +
-							"AND c.contact.deleted <> true";
-			
-			TypedQuery<UserContacts> query = em.createQuery(hql, UserContacts.class); 
+			TypedQuery<UserContact> query = em.createNamedQuery("getContactsByShareCalendar", UserContact.class); 
 			query.setParameter("contactId", contactId);
 			query.setParameter("shareCalendar", shareCalendar);
-			List<UserContacts> ll = query.getResultList();
-			
-			return ll;
-			
+			return query.getResultList();
 		} catch (Exception e) {
 			log.error("[getContactsByShareCalendar]",e);
 		}
 		return null;
 	}
 	
-	public List<UserContacts> getContactRequestsByUserAndStatus(Long user_id, Boolean pending) {
+	public List<UserContact> getContactRequestsByUserAndStatus(Long user_id, Boolean pending) {
 		try {
-			
-			String hql = "select c from UserContacts c " +
-							"where c.contact.user_id = :user_id " +
-							"AND c.pending = :pending " +
-							"AND c.contact.deleted <> true";
-			
-			TypedQuery<UserContacts> query = em.createQuery(hql, UserContacts.class); 
+			TypedQuery<UserContact> query = em.createNamedQuery("getContactRequestsByUserAndStatus", UserContact.class); 
 			query.setParameter("user_id", user_id);
 			query.setParameter("pending", pending);
-			List<UserContacts> ll = query.getResultList();
-			
-			return ll;
-			
+			return query.getResultList();
 		} catch (Exception e) {
 			log.error("[getContactRequestsByUserAndStatus]",e);
 		}
 		return null;
 	}
 	
-	public UserContacts getUserContacts(Long userContactId) {
+	public UserContact getUserContacts(Long userContactId) {
 		try {
-			
-			String hql = "select c from UserContacts c " +
-							"where c.userContactId = :userContactId";
-			
-			TypedQuery<UserContacts> query = em.createQuery(hql, UserContacts.class); 
+			TypedQuery<UserContact> query = em.createNamedQuery("getUserContactsById", UserContact.class); 
 			query.setParameter("userContactId", userContactId);
-			UserContacts userContacts = null;
+			UserContact userContacts = null;
 			try {
 				userContacts = query.getSingleResult();
 		    } catch (NoResultException ex) {
 		    }
-			
 			return userContacts;
-			
 		} catch (Exception e) {
 			log.error("[getUserContacts]",e);
 		}
 		return null;
 	}
 	
-	public List<UserContacts> getUserContacts() {
+	public List<UserContact> getUserContacts() {
 		try {
-			
-			String hql = "select c from UserContacts c ";
-			
-			TypedQuery<UserContacts> query = em.createQuery(hql, UserContacts.class); 
-			List<UserContacts> userContacts = query.getResultList();
-			
-			return userContacts;
-			
+			TypedQuery<UserContact> query = em.createNamedQuery("getUserContacts", UserContact.class); 
+			return query.getResultList();
 		} catch (Exception e) {
 			log.error("[getUserContacts]",e);
 		}
@@ -284,7 +223,7 @@ public class UserContactsDao {
 	public Long updateContactStatus(Long userContactId, Boolean pending) {
 		try {
 			
-			UserContacts userContacts = this.getUserContacts(userContactId);
+			UserContact userContacts = this.getUserContacts(userContactId);
 			
 			if (userContacts == null) {
 				return null;
@@ -308,7 +247,7 @@ public class UserContactsDao {
 		return null;
 	}
 	
-	public void updateContact(UserContacts userContacts) {
+	public void updateContact(UserContact userContacts) {
 		try {
 			userContacts.setUpdated(new Date());
 			

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java Tue Feb  5 02:44:03 2013
@@ -33,8 +33,8 @@ import org.apache.openmeetings.Openmeeti
 import org.apache.openmeetings.data.IDataProviderDao;
 import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
 import org.apache.openmeetings.data.basic.dao.OmTimeZoneDao;
-import org.apache.openmeetings.persistence.beans.adresses.Adresses;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.Address;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.apache.openmeetings.utils.DaoHelper;
 import org.apache.openmeetings.utils.crypt.ManageCryptStyle;
 import org.red5.logging.Red5LoggerFactory;
@@ -43,13 +43,13 @@ import org.springframework.beans.factory
 import org.springframework.transaction.annotation.Transactional;
 
 /**
- * CRUD operations for {@link Users}
+ * CRUD operations for {@link User}
  * 
  * @author swagner, solomax
  * 
  */
 @Transactional
-public class UsersDao implements IDataProviderDao<Users> {
+public class UsersDao implements IDataProviderDao<User> {
 
 	private static final Logger log = Red5LoggerFactory.getLogger(
 			UsersDao.class, OpenmeetingsVariables.webAppRootKey);
@@ -69,7 +69,7 @@ public class UsersDao implements IDataPr
 	private StateDao stateDaoImpl;
 
 	/**
-	 * Get a new instance of the {@link Users} entity, with all default values
+	 * Get a new instance of the {@link User} entity, with all default values
 	 * set
 	 * 
 	 * @param currentUser
@@ -77,8 +77,8 @@ public class UsersDao implements IDataPr
 	 *            one (if the current user has one)
 	 * @return
 	 */
-	public Users getNewUserInstance(Users currentUser) {
-		Users user = new Users();
+	public User getNewUserInstance(User currentUser) {
+		User user = new User();
 		user.setSalutations_id(1L); // TODO: Fix default selection to be
 									// configurable
 		user.setLevel_id(1L);
@@ -88,7 +88,7 @@ public class UsersDao implements IDataPr
 		user.setForceTimeZoneCheck(false);
 		user.setSendSMS(false);
 		user.setAge(new Date());
-		Adresses adresses = new Adresses();
+		Address adresses = new Address();
 		adresses.setStates(stateDaoImpl.getStateById(1L));
 		user.setAdresses(adresses);
 		user.setStatus(1);
@@ -98,30 +98,20 @@ public class UsersDao implements IDataPr
 		return user;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.openmeetings.data.OmDAO#get(int, int)
-	 */
-	public List<Users> get(int first, int count) {
-		TypedQuery<Users> q = em.createNamedQuery("getNondeletedUsers", Users.class);
+	public List<User> get(int first, int count) {
+		TypedQuery<User> q = em.createNamedQuery("getNondeletedUsers", User.class);
 		q.setFirstResult(first);
 		q.setMaxResults(count);
 		return q.getResultList();
 	}
 
-	public List<Users> get(String search, int start, int count, String sort) {
-		TypedQuery<Users> q = em.createQuery(DaoHelper.getSearchQuery("Users", "u", search, true, false, sort, searchFields), Users.class);
+	public List<User> get(String search, int start, int count, String sort) {
+		TypedQuery<User> q = em.createQuery(DaoHelper.getSearchQuery("User", "u", search, true, false, sort, searchFields), User.class);
 		q.setFirstResult(start);
 		q.setMaxResults(count);
 		return q.getResultList();
 	}
 	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.openmeetings.data.OmDAO#count()
-	 */
 	public long count() {
 		// get all users
 		TypedQuery<Long> q = em.createNamedQuery("countNondeletedUsers", Long.class);
@@ -129,23 +119,16 @@ public class UsersDao implements IDataPr
 	}
 
 	public long count(String search) {
-		TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery("Users", "u", search, true, true, null, searchFields), Long.class);
+		TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery("User", "u", search, true, true, null, searchFields), Long.class);
 		return q.getSingleResult();
 	}
 	
-	public List<Users> get(String search) {
-		TypedQuery<Users> q = em.createQuery(DaoHelper.getSearchQuery("Users", "u", search, true, false, null, searchFields), Users.class);
+	public List<User> get(String search) {
+		TypedQuery<User> q = em.createQuery(DaoHelper.getSearchQuery("User", "u", search, true, false, null, searchFields), User.class);
 		return q.getResultList();
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.openmeetings.data.OmDAO#update(org.apache.openmeetings.persistence
-	 * .beans.OmEntity, long)
-	 */
-	public Users update(Users u, long userId) {
+	public User update(User u, long userId) {
 		if (u.getUser_id() == null) {
 			u.setStarttime(new Date());
 			em.persist(u);
@@ -156,31 +139,18 @@ public class UsersDao implements IDataPr
 		return u;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.openmeetings.data.OmDAO#delete(org.apache.openmeetings.persistence
-	 * .beans.OmEntity, long)
-	 */
-	public void delete(Users u, long userId) {
+	public void delete(User u, long userId) {
 		deleteUserID(u.getUser_id());
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.openmeetings.data.OmDAO#get(long)
-	 */
-	public Users get(long user_id) {
+	public User get(long user_id) {
 		if (user_id > 0) {
 			try {
-				TypedQuery<Users> query = em.createQuery(
-						"select c from Users as c where c.user_id = :user_id",
-						Users.class);
+				TypedQuery<User> query = em.createNamedQuery("getUserById",
+						User.class);
 				query.setParameter("user_id", user_id);
 
-				Users users = null;
+				User users = null;
 				try {
 					users = query.getSingleResult();
 				} catch (NoResultException ex) {
@@ -198,11 +168,11 @@ public class UsersDao implements IDataPr
 	public Long deleteUserID(long userId) {
 		try {
 			if (userId != 0) {
-				Users us = get(userId);
+				User us = get(userId);
 				us.setDeleted(true);
 				us.setUpdatetime(new Date());
 				us.setSipUser(null);
-				Adresses adr = us.getAdresses();
+				Address adr = us.getAdresses();
 				if (adr != null) {
 					adr.setDeleted(true);
 				}
@@ -222,9 +192,9 @@ public class UsersDao implements IDataPr
 		return null;
 	}
 
-	public List<Users> getAllUsers() {
+	public List<User> getAllUsers() {
 		try {
-			TypedQuery<Users> q = em.createNamedQuery("getNondeletedUsers", Users.class);
+			TypedQuery<User> q = em.createNamedQuery("getNondeletedUsers", User.class);
 			return q.getResultList();
 		} catch (Exception ex2) {
 			log.error("[getAllUsers] ", ex2);
@@ -232,12 +202,12 @@ public class UsersDao implements IDataPr
 		return null;
 	}
 
-	public List<Users> getAllUsersDeleted() {
+	public List<User> getAllUsersDeleted() {
 		try {
-			TypedQuery<Users> q = em.createNamedQuery("getAllUsers",
-					Users.class);
+			TypedQuery<User> q = em.createNamedQuery("getAllUsers",
+					User.class);
 			@SuppressWarnings("unchecked")
-			OpenJPAQuery<Users> kq = OpenJPAPersistence.cast(q);
+			OpenJPAQuery<User> kq = OpenJPAPersistence.cast(q);
 			kq.getFetchPlan().addFetchGroup("backupexport");
 			return kq.getResultList();
 		} catch (Exception ex2) {
@@ -254,10 +224,8 @@ public class UsersDao implements IDataPr
 	 */
 	public boolean checkUserLogin(String DataValue) {
 		try {
-			TypedQuery<Users> query = em
-					.createQuery(
-							"select c from Users as c where c.login = :DataValue AND c.deleted <> :deleted",
-							Users.class);
+			TypedQuery<User> query = em
+					.createNamedQuery("checkUserLogin", User.class);
 			query.setParameter("DataValue", DataValue);
 			query.setParameter("deleted", true);
 			int count = query.getResultList().size();
@@ -271,14 +239,12 @@ public class UsersDao implements IDataPr
 		return true;
 	}
 
-	public Users getUserByName(String login) {
+	public User getUserByName(String login) {
 		try {
-			String hql = "SELECT u FROM Users as u "
-					+ " where u.login = :login" + " AND u.deleted <> :deleted";
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createNamedQuery("getUserByName", User.class);
 			query.setParameter("login", login);
 			query.setParameter("deleted", true);
-			Users us = null;
+			User us = null;
 			try {
 				us = query.getSingleResult();
 			} catch (NoResultException ex) {
@@ -290,15 +256,12 @@ public class UsersDao implements IDataPr
 		return null;
 	}
 
-	public Users getUserByEmail(String email) {
+	public User getUserByEmail(String email) {
 		try {
-			String hql = "SELECT u FROM Users as u "
-					+ " where u.adresses.email = :email"
-					+ " AND u.deleted <> :deleted";
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createNamedQuery("getUserByEmail", User.class);
 			query.setParameter("email", email);
 			query.setParameter("deleted", true);
-			Users us = null;
+			User us = null;
 			try {
 				us = query.getSingleResult();
 			} catch (NoResultException ex) {
@@ -314,13 +277,10 @@ public class UsersDao implements IDataPr
 		try {
 			if (hash.length() == 0)
 				return new Long(-5);
-			String hql = "SELECT u FROM Users as u "
-					+ " where u.resethash = :resethash"
-					+ " AND u.deleted <> :deleted";
-			TypedQuery<Users> query = em.createQuery(hql, Users.class);
+			TypedQuery<User> query = em.createNamedQuery("getUserByHash", User.class);
 			query.setParameter("resethash", hash);
 			query.setParameter("deleted", true);
-			Users us = null;
+			User us = null;
 			try {
 				us = query.getSingleResult();
 			} catch (NoResultException ex) {
@@ -339,8 +299,8 @@ public class UsersDao implements IDataPr
 	public Object resetPassByHash(String hash, String pass) {
 		try {
 			Object u = this.getUserByHash(hash);
-			if (u instanceof Users) {
-				Users us = (Users) u;
+			if (u instanceof User) {
+				User us = (User) u;
 				us.updatePassword(cryptManager, configDao, pass);
 				us.setResethash("");
 				update(us, 1L);
@@ -360,15 +320,8 @@ public class UsersDao implements IDataPr
 	 */
 	public Long selectMaxFromUsersWithSearch(String search) {
 		try {
-
-			String hql = "select count(c.user_id) from Users c "
-					+ "where c.deleted = false " + "AND ("
-					+ "lower(c.login) LIKE :search "
-					+ "OR lower(c.firstname) LIKE :search "
-					+ "OR lower(c.lastname) LIKE :search " + ")";
-
 			// get all users
-			TypedQuery<Long> query = em.createQuery(hql, Long.class);
+			TypedQuery<Long> query = em.createNamedQuery("selectMaxFromUsersWithSearch", Long.class);
 			query.setParameter("search", StringUtils.lowerCase(search));
 			List<Long> ll = query.getResultList();
 			log.info("selectMaxFromUsers" + ll.get(0));

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/whiteboard/dto/RoomStatus.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/whiteboard/dto/RoomStatus.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/whiteboard/dto/RoomStatus.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/whiteboard/dto/RoomStatus.java Tue Feb  5 02:44:03 2013
@@ -20,7 +20,7 @@ package org.apache.openmeetings.data.whi
 
 import java.util.List;
 
-import org.apache.openmeetings.persistence.beans.rooms.Client;
+import org.apache.openmeetings.persistence.beans.room.Client;
 
 public class RoomStatus {
 	

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java Tue Feb  5 02:44:03 2013
@@ -26,7 +26,7 @@ import org.apache.openmeetings.data.flvr
 import org.apache.openmeetings.data.user.dao.UsersDao;
 import org.apache.openmeetings.documents.beans.ConverterProcessResult;
 import org.apache.openmeetings.documents.beans.ConverterProcessResultList;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.apache.openmeetings.utils.OmFileHelper;
 import org.apache.openmeetings.utils.ProcessHelper;
 import org.red5.logging.Red5LoggerFactory;
@@ -99,7 +99,7 @@ public class GenerateImage extends BaseC
 		fToDelete.delete();
 
 		String pictureuri = destinationFile.getName();
-		Users us = usersDao.get(users_id);
+		User us = usersDao.get(users_id);
 		us.setUpdatetime(new java.util.Date());
 		us.setPictureuri(pictureuri);
 		usersDao.update(us, users_id);

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java Tue Feb  5 02:44:03 2013
@@ -35,11 +35,11 @@ import org.apache.openmeetings.data.user
 import org.apache.openmeetings.data.user.dao.StateDao;
 import org.apache.openmeetings.data.user.dao.UsersDao;
 import org.apache.openmeetings.ldap.config.ConfigReader;
-import org.apache.openmeetings.persistence.beans.adresses.States;
 import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.State;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.apache.openmeetings.remote.util.SessionVariablesUtil;
-import org.apache.openmeetings.persistence.beans.rooms.Client;
+import org.apache.openmeetings.persistence.beans.room.Client;
 import org.apache.openmeetings.utils.OmFileHelper;
 import org.apache.openmeetings.utils.crypt.ManageCryptStyle;
 import org.red5.logging.Red5LoggerFactory;
@@ -424,7 +424,7 @@ public class LdapLoginManagement {
 
 		// check if user already exists
 
-		Users u = null;
+		User u = null;
 
 		try {
 			u = userManagement.getUserByLogin(user);
@@ -519,7 +519,7 @@ public class LdapLoginManagement {
 				}
 
 				// Return UserObject
-				Users u2 = userManagement.getUserById(userid);
+				User u2 = userManagement.getUserById(userid);
 
 				if (u2 == null)
 					return new Long(-1);
@@ -649,10 +649,10 @@ public class LdapLoginManagement {
 
 		if (state != null) {
 			// Lookup for states
-			List<States> states = statemanagement.getStates();
+			List<State> states = statemanagement.getStates();
 
 			for (int i = 0; i < states.size(); i++) {
-				States oneState = states.get(i);
+				State oneState = states.get(i);
 
 				if (oneState.getName().equals(state)) {
 					state_id = oneState.getState_id();

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java Tue Feb  5 02:44:03 2013
@@ -35,7 +35,7 @@ import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -89,7 +89,7 @@ public class Configuration implements Se
 	@ManyToOne(fetch = FetchType.LAZY)
 	@JoinColumn(name = "user_id")
 	@Element(name = "user_id", data = true, required = false)
-	private Users user;
+	private User user;
 
 	public String getComment() {
 		return comment;
@@ -147,11 +147,11 @@ public class Configuration implements Se
 		this.deleted = deleted;
 	}
 
-	public Users getUser() {
+	public User getUser() {
 		return user;
 	}
 
-	public void setUser(Users user) {
+	public void setUser(User user) {
 		this.user = user;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java Tue Feb  5 02:44:03 2013
@@ -35,7 +35,7 @@ import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -80,11 +80,11 @@ public class LdapConfig implements Seria
 	
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="insertedby_id", updatable=true, insertable=true)
-	public Users insertedby;
+	public User insertedby;
 	
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="updatedby_id", updatable=true, insertable=true)
-	public Users updatedby;
+	public User updatedby;
 	
 	@Column(name="deleted")
 	private boolean deleted;
@@ -150,17 +150,17 @@ public class LdapConfig implements Seria
 		this.updated = updated;
 	}
 	
-	public Users getInsertedby() {
+	public User getInsertedby() {
 		return insertedby;
 	}
-	public void setInsertedby(Users insertedby) {
+	public void setInsertedby(User insertedby) {
 		this.insertedby = insertedby;
 	}
 	
-	public Users getUpdatedby() {
+	public User getUpdatedby() {
 		return updatedby;
 	}
-	public void setUpdatedby(Users updatedby) {
+	public void setUpdatedby(User updatedby) {
 		this.updatedby = updatedby;
 	}
 	

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Server.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Server.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Server.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Server.java Tue Feb  5 02:44:03 2013
@@ -36,7 +36,7 @@ import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -79,11 +79,11 @@ public class Server implements Serializa
 
 	@ManyToOne(fetch = FetchType.LAZY)
 	@JoinColumn(name = "insertedby_id", updatable = true, insertable = true)
-	public Users insertedby;
+	public User insertedby;
 
 	@ManyToOne(fetch = FetchType.LAZY)
 	@JoinColumn(name = "updatedby_id", updatable = true, insertable = true)
-	public Users updatedby;
+	public User updatedby;
 
 	@Lob
 	@Column(name = "comment_field", length = 2048)
@@ -170,19 +170,19 @@ public class Server implements Serializa
 		this.updated = updated;
 	}
 
-	public Users getInsertedby() {
+	public User getInsertedby() {
 		return insertedby;
 	}
 
-	public void setInsertedby(Users insertedby) {
+	public void setInsertedby(User insertedby) {
 		this.insertedby = insertedby;
 	}
 
-	public Users getUpdatedby() {
+	public User getUpdatedby() {
 		return updatedby;
 	}
 
-	public void setUpdatedby(Users updatedby) {
+	public void setUpdatedby(User updatedby) {
 		this.updatedby = updatedby;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java Tue Feb  5 02:44:03 2013
@@ -38,8 +38,8 @@ import javax.persistence.NamedQuery;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
 
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -106,7 +106,7 @@ public class Appointment implements Seri
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "user_id", nullable = true)
 	@Element(name="users_id", data=true, required=false)
-	private Users userId;
+	private User userId;
 
 	@Column(name = "starttime")
 	private Date starttime;
@@ -142,7 +142,7 @@ public class Appointment implements Seri
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "room_id", nullable = true)
 	@Element(name="room_id", data=true, required=false)
-	private Rooms room;
+	private Room room;
 
 	@Column(name = "icalId")
 	@Element(data=true, required=false)
@@ -178,11 +178,11 @@ public class Appointment implements Seri
 		this.appointmentId = appointmentId;
 	}
 
-	public Users getUserId() {
+	public User getUserId() {
 		return userId;
 	}
 
-	public void setUserId(Users userId) {
+	public void setUserId(User userId) {
 		this.userId = userId;
 	}
 
@@ -318,11 +318,11 @@ public class Appointment implements Seri
 		this.meetingMember = meetingMember;
 	}
 
-	public Rooms getRoom() {
+	public Room getRoom() {
 		return room;
 	}
 
-	public void setRoom(Rooms room) {
+	public void setRoom(Room room) {
 		this.room = room;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentCategory.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentCategory.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentCategory.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentCategory.java Tue Feb  5 02:44:03 2013
@@ -21,7 +21,7 @@ package org.apache.openmeetings.persiste
 import java.io.Serializable;
 import java.util.Date;
 
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 
 
 
@@ -50,7 +50,7 @@ public class AppointmentCategory impleme
 	
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="user_id", nullable=true)
-	private Users user;
+	private User user;
 	
 	@Column(name="starttime")
 	private Date starttime;
@@ -79,10 +79,10 @@ public class AppointmentCategory impleme
 		this.name = name;
 	}
 	
-	public Users getUser() {
+	public User getUser() {
 		return user;
 	}
-	public void setUser(Users user) {
+	public void setUser(User user) {
 		this.user = user;
 	}
 	

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java Tue Feb  5 02:44:03 2013
@@ -31,7 +31,7 @@ import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 
 
 @Entity
@@ -48,7 +48,7 @@ public class AppointmentReminderTyps imp
 	
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="user_id", nullable=true)
-	private Users user;
+	private User user;
 	
 	@Column(name="starttime")
 	private Date starttime;
@@ -73,10 +73,10 @@ public class AppointmentReminderTyps imp
 		this.name = name;
 	}
 	
-	public Users getUser() {
+	public User getUser() {
 		return user;
 	}
-	public void setUser(Users user) {
+	public void setUser(User user) {
 		this.user = user;
 	}
 	

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/MeetingMember.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/MeetingMember.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/MeetingMember.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/calendar/MeetingMember.java Tue Feb  5 02:44:03 2013
@@ -33,7 +33,7 @@ import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
 import org.apache.openmeetings.persistence.beans.invitation.Invitations;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -52,7 +52,7 @@ public class MeetingMember implements Se
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="user_id", nullable=true)
 	@Element(name="userid", data=true, required=false)
-	private Users userid;
+	private User userid;
 	
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="appointment_id", nullable=true)
@@ -114,10 +114,10 @@ public class MeetingMember implements Se
 		this.meetingMemberId = groupMemberId;
 	}
 	
-	public Users getUserid() {
+	public User getUserid() {
 		return userid;
 	}
-	public void setUserid(Users userid) {
+	public void setUserid(User userid) {
 		this.userid = userid;
 	}
 	

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java Tue Feb  5 02:44:03 2013
@@ -33,8 +33,8 @@ import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -57,7 +57,7 @@ public class ChatMessage implements Seri
 	@ManyToOne
 	@JoinColumn(name = "from_user_id")
 	@Element(name = "fromUserId", data = true, required = false)
-	private Users fromUser;
+	private User fromUser;
 	
 	// necessary to hold messages from external guests enters by invitation hash
 	@Column(name = "from_email")
@@ -71,12 +71,12 @@ public class ChatMessage implements Seri
 	@ManyToOne
 	@JoinColumn(name = "to_room_id")
 	@Element(name = "toRoomId", data = true, required = false)
-	private Rooms toRoom;
+	private Room toRoom;
 	
 	@ManyToOne
 	@JoinColumn(name = "to_user_id")
 	@Element(name = "toUserId", data = true, required = false)
-	private Users toUser;
+	private User toUser;
 
 	// necessary to hold messages to external guests enters by invitation hash
 	@Column(name = "to_email")
@@ -103,11 +103,11 @@ public class ChatMessage implements Seri
 		this.id = id;
 	}
 
-	public Users getFromUser() {
+	public User getFromUser() {
 		return fromUser;
 	}
 
-	public void setFromUser(Users fromUser) {
+	public void setFromUser(User fromUser) {
 		this.fromUser = fromUser;
 	}
 
@@ -127,19 +127,19 @@ public class ChatMessage implements Seri
 		this.fromName = fromName;
 	}
 
-	public Rooms getToRoom() {
+	public Room getToRoom() {
 		return toRoom;
 	}
 
-	public void setToRoom(Rooms toRoom) {
+	public void setToRoom(Room toRoom) {
 		this.toRoom = toRoom;
 	}
 
-	public Users getToUser() {
+	public User getToUser() {
 		return toUser;
 	}
 
-	public void setToUser(Users toUser) {
+	public void setToUser(User toUser) {
 		this.toUser = toUser;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java Tue Feb  5 02:44:03 2013
@@ -34,7 +34,7 @@ import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -67,7 +67,7 @@ public class Organisation_Users implemen
 
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "user_id", insertable = true, updatable = true)
-	private Users user;
+	private User user;
 	
 	@Column(name = "starttime")
 	private Date starttime;
@@ -180,11 +180,11 @@ public class Organisation_Users implemen
 		return true;
 	}
 
-	public Users getUser() {
+	public User getUser() {
 		return user;
 	}
 
-	public void setUser(Users user) {
+	public void setUser(User user) {
 		this.user = user;
 	}
 }

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/flvrecord/FlvRecording.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/flvrecord/FlvRecording.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/flvrecord/FlvRecording.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/flvrecord/FlvRecording.java Tue Feb  5 02:44:03 2013
@@ -36,8 +36,8 @@ import javax.persistence.OneToMany;
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.ElementList;
 import org.simpleframework.xml.Root;
@@ -191,10 +191,10 @@ public class FlvRecording implements Ser
 
 	// Not Mapped
 	@Transient
-	private Users creator;
+	private User creator;
 
 	@Transient
-	private Rooms room;
+	private Room room;
 
 	@Transient
 	private List<FlvRecordingLog> flvRecordingLog;
@@ -368,19 +368,19 @@ public class FlvRecording implements Ser
 		this.flvRecordingMetaData = flvRecordingMetaData;
 	}
 
-	public Users getCreator() {
+	public User getCreator() {
 		return creator;
 	}
 
-	public void setCreator(Users creator) {
+	public void setCreator(User creator) {
 		this.creator = creator;
 	}
 
-	public Rooms getRoom() {
+	public Room getRoom() {
 		return room;
 	}
 
-	public void setRoom(Rooms room) {
+	public void setRoom(Room room) {
 		this.room = room;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/invitation/Invitations.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/invitation/Invitations.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/invitation/Invitations.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/invitation/Invitations.java Tue Feb  5 02:44:03 2013
@@ -32,8 +32,8 @@ import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.user.User;
 
 @Entity
 @Table(name = "invitations")
@@ -47,7 +47,7 @@ public class Invitations implements Seri
 
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "invitedBy", nullable = true)
-	private Users invitedBy;
+	private User invitedBy;
 	
 	@Column(name = "starttime")
 	private Date starttime;
@@ -60,7 +60,7 @@ public class Invitations implements Seri
 
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "roomid", nullable = true)
-	private Rooms room;
+	private Room room;
 
 	// the hash for the link
 	@Column(name = "hash")
@@ -128,19 +128,19 @@ public class Invitations implements Seri
 		this.invitations_id = invitations_id;
 	}
 
-	public Rooms getRoom() {
+	public Room getRoom() {
 		return room;
 	}
 
-	public void setRoom(Rooms room) {
+	public void setRoom(Room room) {
 		this.room = room;
 	}
 
-	public Users getInvitedBy() {
+	public User getInvitedBy() {
 		return invitedBy;
 	}
 
-	public void setInvitedBy(Users invitedBy) {
+	public void setInvitedBy(User invitedBy) {
 		this.invitedBy = invitedBy;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPoll.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPoll.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPoll.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPoll.java Tue Feb  5 02:44:03 2013
@@ -34,8 +34,8 @@ import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 
-import org.apache.openmeetings.persistence.beans.rooms.Rooms;
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.ElementList;
 import org.simpleframework.xml.Root;
@@ -73,12 +73,12 @@ public class RoomPoll {
 	@OneToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "users_id")
 	@Element(name="createdbyuserid", data=true, required=false)
-	private Users createdBy;
+	private User createdBy;
 	
 	@OneToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "rooms_id")
 	@Element(name="roomid", data=true, required=false)
-	private Rooms room;
+	private Room room;
 	
 	@OneToMany(fetch = FetchType.EAGER, cascade=CascadeType.ALL)
 	@JoinColumn(name = "room_poll_id")
@@ -88,7 +88,7 @@ public class RoomPoll {
 	/**
 	 * @return the createdBy
 	 */
-	public Users getCreatedBy() {
+	public User getCreatedBy() {
 		return createdBy;
 	}
 
@@ -96,7 +96,7 @@ public class RoomPoll {
 	 * @param createdBy
 	 *            the createdBy to set
 	 */
-	public void setCreatedBy(Users createdBy) {
+	public void setCreatedBy(User createdBy) {
 		this.createdBy = createdBy;
 	}
 
@@ -174,11 +174,11 @@ public class RoomPoll {
 		this.pollType = pollType;
 	}
 
-	public Rooms getRoom() {
+	public Room getRoom() {
 		return room;
 	}
 
-	public void setRoom(Rooms room) {
+	public void setRoom(Room room) {
 		this.room = room;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPollAnswers.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPollAnswers.java?rev=1442455&r1=1442454&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPollAnswers.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/poll/RoomPollAnswers.java Tue Feb  5 02:44:03 2013
@@ -27,7 +27,7 @@ import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 
-import org.apache.openmeetings.persistence.beans.user.Users;
+import org.apache.openmeetings.persistence.beans.user.User;
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
@@ -38,7 +38,7 @@ public class RoomPollAnswers {
 	@OneToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "users_id")
 	@Element(name="voteduserid", data=false, required=false)
-	private Users votedUser;
+	private User votedUser;
 	
 	@Column(name = "answer")
 	@Element(data=false, required=false)
@@ -104,7 +104,7 @@ public class RoomPollAnswers {
 	/**
 	 * @return the votedClient
 	 */
-	public Users getVotedUser() {
+	public User getVotedUser() {
 		return votedUser;
 	}
 
@@ -112,7 +112,7 @@ public class RoomPollAnswers {
 	 * @param votedClient
 	 *            the votedClient to set
 	 */
-	public void setVotedUser(Users votedUser) {
+	public void setVotedUser(User votedUser) {
 		this.votedUser = votedUser;
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Client.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Client.java?rev=1442455&r1=1442415&r2=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Client.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Client.java Tue Feb  5 02:44:03 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.persistence.beans.rooms;
+package org.apache.openmeetings.persistence.beans.room;
 
 import java.io.Serializable;
 import java.util.Date;

Copied: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Room.java (from r1442415, openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/Rooms.java)
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Room.java?p2=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Room.java&p1=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/Rooms.java&r1=1442415&r2=1442455&rev=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/Rooms.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/Room.java Tue Feb  5 02:44:03 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.persistence.beans.rooms;
+package org.apache.openmeetings.persistence.beans.room;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -50,16 +50,35 @@ import org.simpleframework.xml.Root;
 
 @Entity
 @NamedQueries({
-	@NamedQuery(name = "getNondeletedRooms", query = "SELECT r FROM Rooms r WHERE r.deleted = false"),
-	@NamedQuery(name = "getPublicRoomsOrdered", query = "SELECT r from Rooms r WHERE r.ispublic= true AND r.deleted= false AND r.appointment = false ORDER BY r.name ASC"),
-	@NamedQuery(name = "getRoomById", query = "SELECT r FROM Rooms r WHERE r.deleted = false AND r.rooms_id = :id"),
-	@NamedQuery(name = "getSipRoomIdsByIds", query = "SELECT r.rooms_id FROM Rooms r WHERE r.deleted = false AND r.sipEnabled = true AND r.rooms_id IN :ids"),
-	@NamedQuery(name = "countRooms", query = "SELECT COUNT(r) FROM Rooms r WHERE r.deleted = false"),
-	@NamedQuery(name = "getBackupRooms", query = "SELECT r FROM Rooms r LEFT JOIN FETCH r.moderators WHERE r.deleted = false ")
+	@NamedQuery(name = "getNondeletedRooms", query = "SELECT r FROM Room r WHERE r.deleted = false"),
+	@NamedQuery(name = "getPublicRooms", query = "SELECT r from Room r "
+			+ "JOIN r.roomtype as rt "
+			+ "WHERE r.ispublic=:ispublic and r.deleted=:deleted and rt.roomtypes_id=:roomtypes_id"),
+	@NamedQuery(name = "getPublicRoomsWithoutType", query = "SELECT r from Room r " + "WHERE "
+						+ "r.ispublic = :ispublic and r.deleted <> :deleted "
+						+ "ORDER BY r.name ASC"),
+	@NamedQuery(name = "getAppointedMeetings", query = "SELECT r from Room r "
+			+ "JOIN r.roomtype as rt " + "WHERE "
+			+ "r.deleted=:deleted and r.appointment=:appointed"),	
+	@NamedQuery(name = "getRoomByOwnerAndTypeId", query = "select c from Room as c "
+					+ "where c.ownerId = :ownerId "
+					+ "AND c.roomtype.roomtypes_id = :roomtypesId "
+					+ "AND c.deleted <> :deleted"),	
+										
+	@NamedQuery(name = "selectMaxFromRooms", query = "select count(c.rooms_id) from Room c "
+			+ "where c.deleted <> true AND c.name LIKE :search "),
+	@NamedQuery(name = "getRoomByExternalId", query = "select c from Room 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"),
+	@NamedQuery(name = "getPublicRoomsOrdered", query = "SELECT r from Room r WHERE r.ispublic= true AND r.deleted= false AND r.appointment = false ORDER BY r.name ASC"),
+	@NamedQuery(name = "getRoomById", query = "SELECT r FROM Room r WHERE r.deleted = false AND r.rooms_id = :id"),
+	@NamedQuery(name = "getSipRoomIdsByIds", query = "SELECT r.rooms_id FROM Room r WHERE r.deleted = false AND r.sipEnabled = true AND r.rooms_id IN :ids"),
+	@NamedQuery(name = "countRooms", query = "SELECT COUNT(r) FROM Room r WHERE r.deleted = false"),
+	@NamedQuery(name = "getBackupRooms", query = "SELECT r FROM Room r LEFT JOIN FETCH r.moderators WHERE r.deleted = false ")
 })
-@Table(name = "rooms")
+@Table(name = "room")
 @Root(name = "room")
-public class Rooms implements Serializable, IDataProviderEntity {
+public class Room implements Serializable, IDataProviderEntity {
 	private static final long serialVersionUID = -2860312283159251568L;
 	@Id
 	@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -79,7 +98,7 @@ public class Rooms implements Serializab
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "roomtypes_id")
 	@Element(name = "roomtypeId", data = true, required = false)
-	private RoomTypes roomtype;
+	private RoomType roomtype;
 
 	@Column(name = "starttime")
 	private Date starttime;
@@ -103,7 +122,7 @@ public class Rooms implements Serializab
 	@Element(data = true, required = false)
 	private boolean appointment;
 
-	// Vars to simulate external Rooms
+	// Vars to simulate external Room
 	@Column(name = "externalRoomId")
 	@Element(data = true, required = false)
 	private Long externalRoomId;
@@ -213,7 +232,7 @@ public class Rooms implements Serializab
 	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
 	@JoinColumn(name = "roomId")
 	@ElementList(name = "room_moderators", required=false)
-	private List<RoomModerators> moderators;
+	private List<RoomModerator> moderators;
 
 	@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
 	@PrimaryKeyJoinColumn(name="confno", referencedColumnName="confno")
@@ -228,7 +247,7 @@ public class Rooms implements Serializab
 	@JoinColumn(name = "rooms_id", insertable = true, updatable = true)
 	@ElementDependent
 	@org.simpleframework.xml.Transient
-	private List<Rooms_Organisation> roomOrganisations = new ArrayList<Rooms_Organisation>();
+	private List<RoomOrganisation> roomOrganisations = new ArrayList<RoomOrganisation>();
 
 	@Transient
 	private List<Client> currentusers;
@@ -257,11 +276,11 @@ public class Rooms implements Serializab
 		this.rooms_id = rooms_id;
 	}
 
-	public RoomTypes getRoomtype() {
+	public RoomType getRoomtype() {
 		return roomtype;
 	}
 
-	public void setRoomtype(RoomTypes roomtype) {
+	public void setRoomtype(RoomType roomtype) {
 		this.roomtype = roomtype;
 	}
 
@@ -489,11 +508,11 @@ public class Rooms implements Serializab
 		this.showMicrophoneStatus = showMicrophoneStatus;
 	}
 
-	public List<RoomModerators> getModerators() {
+	public List<RoomModerator> getModerators() {
 		return moderators;
 	}
 
-	public void setModerators(List<RoomModerators> moderators) {
+	public void setModerators(List<RoomModerator> moderators) {
 		this.moderators = moderators;
 	}
 
@@ -505,11 +524,11 @@ public class Rooms implements Serializab
 		this.chatModerated = chatModerated;
 	}
 
-	public List<Rooms_Organisation> getRoomOrganisations() {
+	public List<RoomOrganisation> getRoomOrganisations() {
 		return roomOrganisations;
 	}
 
-	public void setRoomOrganisations(List<Rooms_Organisation> roomOrganisations) {
+	public void setRoomOrganisations(List<RoomOrganisation> roomOrganisations) {
 		this.roomOrganisations = roomOrganisations;
 	}
 

Copied: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomModerator.java (from r1442415, openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/RoomModerators.java)
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomModerator.java?p2=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomModerator.java&p1=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/RoomModerators.java&r1=1442415&r2=1442455&rev=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/RoomModerators.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomModerator.java Tue Feb  5 02:44:03 2013
@@ -16,30 +16,41 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.persistence.beans.rooms;
+package org.apache.openmeetings.persistence.beans.room;
 
 import java.io.Serializable;
 import java.util.Date;
 
-
-import org.apache.openmeetings.persistence.beans.user.Users;
-import org.simpleframework.xml.Element;
-import org.simpleframework.xml.Root;
-
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
-import javax.persistence.ManyToOne;
 import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.simpleframework.xml.Element;
+import org.simpleframework.xml.Root;
+
 @Entity
+@NamedQueries({
+	@NamedQuery(name = "getRoomModeratorById", query = "select c from RoomModerator as c " +
+			"where c.roomModeratorsId = :roomModeratorsId"),
+	@NamedQuery(name = "getRoomModeratorByRoomId", query = "select c from RoomModerator as c "
+			+ "where c.roomId = :roomId AND c.deleted <> :deleted"),	
+	@NamedQuery(name = "getRoomModeratorByUserAndRoomId", query = "select c from RoomModerator as c "
+			+ "where c.roomId = :roomId "
+			+ "AND c.deleted <> :deleted "
+			+ "AND c.user.user_id = :user_id"),			
+})
 @Table(name = "rooms_moderator")
 @Root(name = "room_moderator")
-public class RoomModerators implements Serializable {
+public class RoomModerator implements Serializable {
 	private static final long serialVersionUID = 5407758673591515018L;
 	
 	@Id
@@ -57,7 +68,7 @@ public class RoomModerators implements S
 	@ManyToOne(fetch = FetchType.EAGER) 
 	@JoinColumn (name="user_id")
 	@Element(name="user_id", data = true, required=false)
-	private Users user;
+	private User user;
 	
 	@Column(name = "starttime")
 	private Date starttime;
@@ -83,10 +94,10 @@ public class RoomModerators implements S
 	}
 	
 	
-	public Users getUser() {
+	public User getUser() {
 		return user;
 	}
-	public void setUser(Users user) {
+	public void setUser(User user) {
 		this.user = user;
 	}
 	

Copied: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomOrganisation.java (from r1442415, openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/Rooms_Organisation.java)
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomOrganisation.java?p2=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomOrganisation.java&p1=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/Rooms_Organisation.java&r1=1442415&r2=1442455&rev=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/Rooms_Organisation.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomOrganisation.java Tue Feb  5 02:44:03 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.persistence.beans.rooms;
+package org.apache.openmeetings.persistence.beans.room;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -29,6 +29,8 @@ import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 import org.apache.openmeetings.persistence.beans.domain.Organisation;
@@ -36,9 +38,31 @@ import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
 
 @Entity
+@NamedQueries({
+	@NamedQuery(name = "getRoomsOrganisationByOrganisationIdAndRoomType", query = "select c from RoomOrganisation as c "
+			+ "where c.room.roomtypes_id = :roomtypes_id "
+			+ "AND c.organisation.organisation_id = :organisation_id "
+			+ "AND c.deleted <> :deleted"),
+	@NamedQuery(name = "getRoomsOrganisationByOrganisationId", query = "SELECT c FROM RoomOrganisation 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"),
+	@NamedQuery(name = "selectMaxFromRoomsByOrganisation", query = "select c from Rooms_Organisation as c "
+			+ "where c.organisation.organisation_id = :organisation_id "
+			+ "AND c.deleted <> :deleted"),
+	@NamedQuery(name = "getRoomsOrganisationByOrganisationIdAndRoomId", query = "select c from RoomOrganisation as c "
+			+ "where c.room.rooms_id = :rooms_id "
+			+ "AND c.organisation.organisation_id = :organisation_id "
+			+ "AND c.deleted <> :deleted"),
+	@NamedQuery(name = "getRoomsOrganisationByRoomsId", query = "select c from Rooms_Organisation as c "
+			+ "where c.room.rooms_id = :rooms_id "
+			+ "AND c.deleted <> :deleted"),
+})
 @Table(name = "rooms_organisation")
 @Root(name="room_organisation")
-public class Rooms_Organisation implements Serializable {
+public class RoomOrganisation implements Serializable {
 	private static final long serialVersionUID = 4153935045968138984L;
 	@Id
 	@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -49,7 +73,7 @@ public class Rooms_Organisation implemen
 	@ManyToOne(fetch = FetchType.LAZY)
 	@JoinColumn(name="rooms_id", nullable=true)
 	@Element(name="rooms_id", data=true, required=false)
-	private Rooms room;
+	private Room room;
 	
 	@ManyToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name="organisation_id", nullable=true)
@@ -66,11 +90,11 @@ public class Rooms_Organisation implemen
 	@Element(data=true)
 	private boolean deleted;
 
-	public Rooms_Organisation(Organisation org) {
+	public RoomOrganisation(Organisation org) {
 		this.organisation = org;
 	}
 
-	public Rooms_Organisation() {
+	public RoomOrganisation() {
 	}
 
 	public Organisation getOrganisation() {
@@ -80,10 +104,10 @@ public class Rooms_Organisation implemen
 		this.organisation = organisation;
 	}
 	
-	public Rooms getRoom() {
+	public Room getRoom() {
 		return room;
 	}
-	public void setRoom(Rooms room) {
+	public void setRoom(Room room) {
 		this.room = room;
 	}
 

Copied: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomType.java (from r1442415, openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/RoomTypes.java)
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomType.java?p2=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomType.java&p1=openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/RoomTypes.java&r1=1442415&r2=1442455&rev=1442455&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/rooms/RoomTypes.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/room/RoomType.java Tue Feb  5 02:44:03 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.persistence.beans.rooms;
+package org.apache.openmeetings.persistence.beans.room;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -26,11 +26,18 @@ import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 @Entity
-@Table(name = "roomtypes")
-public class RoomTypes implements Serializable {
+@NamedQueries({
+	@NamedQuery(name = "getAllRoomTypes", query = "select c from RoomType as c where c.deleted <> :deleted"),
+	@NamedQuery(name = "getRoomTypesById", query = "select c from RoomType as c " +
+			"where c.roomtypes_id = :roomtypes_id AND c.deleted <> :deleted"),
+})
+@Table(name = "roomtype")
+public class RoomType implements Serializable {
 	private static final long serialVersionUID = -4441029424324591356L;
 	@Id
 	@GeneratedValue(strategy = GenerationType.IDENTITY)



Mime
View raw message