Commits

Anonymous committed 198e3be

Change the names of parameters related to the old domain name SecUserSecondary and SecUser.

git-svn-id: http://svn.encuesta.me/trunk/encuestame@100539e2479b-dd58-4041-9f67-69c9b71f0610

  • Participants
  • Parent commits 38555f1

Comments (0)

Files changed (39)

encuestame-business/src/main/java/org/encuestame/business/service/AbstractBaseService.java

      * @param secUser
      * @return
      */
-    public Notification createNotification(final NotificationEnum description, final String additional,  final Account secUser){
+    public Notification createNotification(final NotificationEnum description, final String additional,  final Account account){
         final Notification notification = new Notification();
         notification.setDescription(description);
-        notification.setSecUser(secUser);
+        notification.setAccount(account);
         notification.setAdditionalDescription(additional);
         getNotificationDao().saveOrUpdate(notification);
         return notification;
            final Integer start) throws EnMeDomainNotFoundException {
         log.info("currentUsername "+currentUsername);
         List<UnitUserBean> loadListUsers = new LinkedList<UnitUserBean>();
-        final UserAccount secUserSecondary = this.getUser(currentUsername);
-        if(secUserSecondary != null){
+        final UserAccount userAccount = this.getUser(currentUsername);
+        if(userAccount != null){
             final Collection<UserAccount> listUsers = getAccountDao()
-                 .retrieveListOwnerUsers(secUserSecondary.getSecUser(), start, maxResults);
+                 .retrieveListOwnerUsers(userAccount.getAccount(), start, maxResults);
                 log.info("list users "+listUsers.size());
                 loadListUsers = ConvertDomainBean.convertCollectionUsersToBean(listUsers);
         }
         Boolean validate = Boolean.FALSE;
         final UserAccount owner = getAccountDao().getUserByUsername(loggedUserName);
         if(user != null && owner != null){
-            if(user.getSecUser().getUid().equals(owner.getSecUser().getUid())){
+            if(user.getAccount().getUid().equals(owner.getAccount().getUid())){
                 validate = Boolean.TRUE;
             }
         }

encuestame-business/src/main/java/org/encuestame/business/service/AbstractDataSource.java

      * @throws EnMeDomainNotFoundException exception
      */
     public final UserAccount getUser(final String username) throws EnMeDomainNotFoundException {
-        final UserAccount secUserSecondary = getAccountDao().getUserByUsername(username);
-        if(secUserSecondary == null){
+        final UserAccount userAccount = getAccountDao().getUserByUsername(username);
+        if(userAccount == null){
             throw new EnMeDomainNotFoundException("user not found");
         } else {
             //TODO: we can add others validations, like is disabled, banned or the account is expired.
      * @throws EnMeDomainNotFoundException exception
      */
     public final Long getPrimaryUser(final String username) throws EnMeDomainNotFoundException{
-        return getUser(username).getSecUser().getUid();
+        return getUser(username).getAccount().getUid();
      }
 
     /**
     }
 
     /**
-     * @return the secUserDao
+     * @return the accountDao
      */
     public final IAccountDao getAccountDao() {
         return accountDao;
     }
 
     /**
-     * @param secUserDao the secUserDao to set
+     * @param accountDao the accountDao to set
      */
     public final void setAccountDao(final IAccountDao accountDao) {
         this.accountDao = accountDao;

encuestame-business/src/main/java/org/encuestame/business/service/AbstractSurveyService.java

             try{
 
                 question.setQuestion(questionBean.getQuestionName());
-                question.setSecUsersQuestion(getAccountDao().getUserById(questionBean.getUserId()));
+                question.setAccountQuestion(getAccountDao().getUserById(questionBean.getUserId()));
                 question.setQidKey(MD5Utils.md5(RandomStringUtils.randomAlphanumeric(500)));
                 question.setSharedQuestion(false);
                 getQuestionDao().saveOrUpdate(question);

encuestame-business/src/main/java/org/encuestame/business/service/LocationService.java

                         .getLocTypeDesc());
                 locationTypeDomain.setLocationTypeLevel(locatTypeBean
                         .getLevel());
-                locationTypeDomain.setUsers(getUser(username).getSecUser());
+                locationTypeDomain.setUsers(getUser(username).getAccount());
                 getCatLocationTypeDao().saveOrUpdate(locationTypeDomain);
                 locatTypeBean.setIdLocType(locationTypeDomain
                         .getLocationTypeId());
                 catLocationDomain.setLocationDescription(location.getName());
                 catLocationDomain.setLocationStatus(Status.ACTIVE);
                 catLocationDomain.setLocationLatitude(location.getLat());
-                catLocationDomain.setSecUsers(getUser(username).getSecUser());
+                catLocationDomain.setAccount(getUser(username).getAccount());
                 catLocationDomain.setLocationLongitude(location.getLng());
                 if(location.getTidtype() != null){
                     catLocationDomain.setTidtype(getCatLocationTypeDao().getLocationById(location.getTidtype()));
                 }
                 getGeoPointDao().saveOrUpdate(catLocationDomain);
                 location.setId(catLocationDomain.getLocateId());
-                createNotification(NotificationEnum.LOCATION_NEW, location.getName() +" is created.", catLocationDomain.getSecUsers());
+                createNotification(NotificationEnum.LOCATION_NEW, location.getName() +" is created.", catLocationDomain.getAccount());
             } catch (Exception e) {
                 throw new EnMeExpcetion(e);
             }
         final GeoPointFolder catLocationFolder = new GeoPointFolder();
         catLocationFolder.setFolderType(GeoPointFolderType.valueOf(locationFolder.getType()));
         catLocationFolder.setLocationFolderName(locationFolder.getName());
-        catLocationFolder.setSecUsers(getUser(username).getSecUser());
+        catLocationFolder.setAccount(getUser(username).getAccount());
         getGeoPointDao().saveOrUpdate(catLocationFolder);
         locationFolder.setId(catLocationFolder.getLocationFolderId());
-        createNotification(NotificationEnum.LOCATION_FOLDER_NEW, "New Folder "+locationFolder.getName() +" is created.", catLocationFolder.getSecUsers());
+        createNotification(NotificationEnum.LOCATION_FOLDER_NEW, "New Folder "+locationFolder.getName() +" is created.", catLocationFolder.getAccount());
         return locationFolder;
     }
 
             location.setLocationCountryName(locationBean.getCountryName());
             location.setLocationLongitude(locationBean.getLng());
             getGeoPointDao().saveOrUpdate(location);
-            createNotification(NotificationEnum.LOCATION_GMAP_UPDATED, "Updated to "+ locationBean.getAddress(), location.getSecUsers());
+            createNotification(NotificationEnum.LOCATION_GMAP_UPDATED, "Updated to "+ locationBean.getAddress(), location.getAccount());
             log.info("location map updated");
         }
     }
             getGeoPointDao().saveOrUpdate(location);
             log.info("location name updated");
             createNotification(NotificationEnum.LOCATION_GMAP_CHANGED_NAME,
-                               lastName+" is update to "+locationBean.getName(), location.getSecUsers());
+                               lastName+" is update to "+locationBean.getName(), location.getAccount());
         }
     }
 
             }
             getGeoPointDao().saveOrUpdate(locationFolder);
             createNotification(NotificationEnum.LOCATION_GMAP_CHANGED_NAME, "Folder name change to "
-                                + locationFolderBean.getName(), locationFolder.getSecUsers());
+                                + locationFolderBean.getName(), locationFolder.getAccount());
         }
     }
 
         else {
             final GeoPoint catLocation = new GeoPoint();
             catLocation.setCatLocationFolder(locationFolder);
-            catLocation.setSecUsers(getUser(username).getSecUser());
+            catLocation.setAccount(getUser(username).getAccount());
             catLocation.setLocationStatus(Status.ACTIVE);
             catLocation.setLocationDescription("Default Item Name");
             getGeoPointDao().saveOrUpdate(catLocation);

encuestame-business/src/main/java/org/encuestame/business/service/PollService.java

         try {
             final Poll pollDomain = new Poll();
             pollDomain.setCreatedAt(pollBean.getCreationDate());
-            pollDomain.setPollOwner(getUser(currentUser).getSecUser());
+            pollDomain.setPollOwner(getUser(currentUser).getAccount());
             pollDomain.setPollCompleted(Boolean.FALSE);
             pollDomain.setCreatedAt(new Date());
             pollDomain.setPollHash(MD5Utils.md5(RandomStringUtils.randomAlphanumeric(500)));
      * @throws EnMeDomainNotFoundException
      */
     public List<UnitPoll> getPollsByFolder(final UnitFolder folder, final String username) throws EnMeDomainNotFoundException{
-        final Account secUser = getUser(username).getSecUser();
-        final List<Poll> polls = getPollDao().getPollsByPollFolder(secUser, getPollFolder(folder.getId()));
+        final Account account = getUser(username).getAccount();
+        final List<Poll> polls = getPollDao().getPollsByPollFolder(account, getPollFolder(folder.getId()));
         return ConvertDomainBean.convertSetToUnitPollBean(polls);
     }
     /**
      * @throws EnMeDomainNotFoundException exception
      */
     public List<UnitFolder> retrieveFolderPoll(final String username) throws EnMeDomainNotFoundException{
-        final Account secUser = getUser(username).getSecUser();
-        final List<IFolder> folders = getPollDao().getPollFolderBySecUser(secUser);
+        final Account account = getUser(username).getAccount();
+        final List<IFolder> folders = getPollDao().getPollFolderBySecUser(account);
         return ConvertDomainBean.convertListToUniUnitFolder(folders);
     }
 
      */
     public UnitFolder createPollFolder(final String folderName, final String username) throws EnMeDomainNotFoundException{
         final PollFolder pollFolder = new PollFolder();
-        pollFolder.setUsers(getUser(username).getSecUser());
+        pollFolder.setUsers(getUser(username).getAccount());
         pollFolder.setCreatedAt(new Date());
         pollFolder.setFolderName(folderName);
         this.getPollDao().saveOrUpdate(pollFolder);

encuestame-business/src/main/java/org/encuestame/business/service/ProjectService.java

      */
     public List<UnitProjectBean> loadListProjects(final String username) throws EnMeDomainNotFoundException {
             final List<UnitProjectBean> listProjects = new ArrayList<UnitProjectBean>();
-            final Collection<Project> projectList = getProjectDaoImp().findProjectsByUserID(getUser(username).getSecUser().getUid());
+            final Collection<Project> projectList = getProjectDaoImp().findProjectsByUserID(getUser(username).getAccount().getUid());
             //log.debug("project by user id: "+projectList.size());
             for (final Project project : projectList) {
                 //log.debug("adding project "+project.getProjectDescription());
             try {
                 final Project projectDomain = new Project();
                 final UserAccount secondary = getAccountDao().getSecondaryUserById(projectBean.getLeader());
-                final Account user = getUser(username).getSecUser();
+                final Account user = getUser(username).getAccount();
                 projectDomain.setProjectDateFinish(projectBean.getDateFinish());
                 projectDomain.setProjectDateStart(projectBean.getDateInit());
                 log.debug("new Project Leader "+projectBean.getName());
         }
         else{
             final UserAccount secondary = getAccountDao().getSecondaryUserById(projectBean.getLeader());
-            final Account user = getUser(username).getSecUser();
+            final Account user = getUser(username).getAccount();
             project.setProjectName(projectBean.getName());
             project.setHideProject(projectBean.getHide());
             project.setLead(secondary);

encuestame-business/src/main/java/org/encuestame/business/service/SecurityService.java

      * @throws EnMeDomainNotFoundException
      */
     public Long totalOwnUsers(final String username) throws EnMeDomainNotFoundException{
-        return getAccountDao().retrieveTotalUsers(getUser(username).getSecUser());
+        return getAccountDao().retrieveTotalUsers(getUser(username).getAccount());
     }
 
     /**
      * @throws EnMeDomainNotFoundException
      */
     public List<UnitGroupBean> loadGroups(final String currentUsername) throws EnMeDomainNotFoundException{
-        final UserAccount secUserSecondary = getUser(currentUsername);
+        final UserAccount userAccount = getUser(currentUsername);
         final List<UnitGroupBean> groupBeans = new ArrayList<UnitGroupBean>();
-        final List<Group> groups = getGroupDao().loadGroupsByUser(secUserSecondary.getSecUser());
+        final List<Group> groups = getGroupDao().loadGroupsByUser(userAccount.getAccount());
         for (Group secGroups : groups) {
             groupBeans.add(ConvertDomainBean.convertGroupDomainToBean(secGroups));
         }
      * @throws EnMeDomainNotFoundException
      */
     public void addNewTwitterAccount(final String account, final String username) throws EnMeDomainNotFoundException{
-        final Account secUsers = getUser(username).getSecUser();
+        final Account user = getUser(username).getAccount();
         final SocialAccount userTwitterAccount = new SocialAccount();
-        userTwitterAccount.setSecUsers(secUsers);
+        userTwitterAccount.setSecUsers(user);
         userTwitterAccount.setTwitterAccount(account);
         userTwitterAccount.setTwitterPassword("");
         userTwitterAccount.setType(TypeAuth.PASSWORD); //By default is PASSWORD.
     public UnitGroupBean createGroup(final UnitGroupBean groupBean, final String username) throws EnMeDomainNotFoundException {
         //log.info("Create Group");
         final Group groupDomain = new Group();
-        final Account secUsers = getUser(username).getSecUser();
+        final Account secUsers = getUser(username).getAccount();
         groupDomain.setGroupDescriptionInfo(groupBean.getGroupDescription());
         groupDomain.setGroupName(groupBean.getGroupName());
         groupDomain.setIdState(null);
-        groupDomain.setSecUsers(secUsers);
+        groupDomain.setAccount(secUsers);
         getGroupDao().saveOrUpdate(groupDomain);
         groupBean.setId(groupDomain.getGroupId());
         return ConvertDomainBean.convertGroupDomainToBean(groupDomain);
      * @return if password is not notified  is returned
      */
     public void createUser(final UnitUserBean userBean, final String username) throws EnMeExpcetion {
-        final UserAccount secondaryUser = new UserAccount();
-        final Account secUsers = getUser(username).getSecUser();
+        final UserAccount userAccount = new UserAccount();
+        final Account account = getUser(username).getAccount();
         //validate email and password
         if (userBean.getEmail() != null && userBean.getUsername() != null) {
-            secondaryUser.setUserEmail(userBean.getEmail());
-            secondaryUser.setUsername(userBean.getUsername());
-            secondaryUser.setSecUser(secUsers);
+            userAccount.setUserEmail(userBean.getEmail());
+            userAccount.setUsername(userBean.getUsername());
+            userAccount.setAccount(account);
         } else {
             throw new EnMeExpcetion("needed email and username to create user");
         }
         String password = null;
         if (userBean.getPassword()!=null) {
              password = userBean.getPassword();
-             secondaryUser.setPassword(EnMePasswordUtils.encryptPassworD(password));
+             userAccount.setPassword(EnMePasswordUtils.encryptPassworD(password));
         }
         else{
             password = generatePassword();
-            secondaryUser.setPassword(EnMePasswordUtils.encryptPassworD(password));
+            userAccount.setPassword(EnMePasswordUtils.encryptPassworD(password));
         }
         //TODO: maybe we need create a table for editor permissions
         //secondaryUser.setPublisher(userBean.getPublisher());
-        secondaryUser.setCompleteName(userBean.getName() == null ? "" : userBean.getName());
-        secondaryUser.setUserStatus(Boolean.TRUE);
-        secondaryUser.setEnjoyDate(new Date());
+        userAccount.setCompleteName(userBean.getName() == null ? "" : userBean.getName());
+        userAccount.setUserStatus(Boolean.TRUE);
+        userAccount.setEnjoyDate(new Date());
             // send to user the password to her emails
             if((getSuspendedNotification())) {
             sendUserPassword(userBean.getEmail(), password);
             }
             // save user
-            getAccountDao().saveOrUpdate(secondaryUser);
+            getAccountDao().saveOrUpdate(userAccount);
             // assing first default group to user
-            final UserAccount retrievedUser = getAccountDao().getSecondaryUserById(secondaryUser.getUid());
+            final UserAccount retrievedUser = getAccountDao().getSecondaryUserById(userAccount.getUid());
             final Permission permission = getPermissionByName(SecurityService.DEFAULT);
             if(permission != null){
                 final List<Permission> all = getPermissionDao().findAllPermissions();
 
     /**
      * Assign Permissions to {@link UserAccount}.
-     * @param secUserSecondary {@link UserAccount}.
+     * @param userAccount {@link UserAccount}.
      * @param secPermissions List of {@link Permission}.
      */
-    private void assingPermission(final UserAccount secUserSecondary , final Set<Permission> secPermissions){
+    private void assingPermission(final UserAccount userAccount , final Set<Permission> secPermissions){
         for (Permission secPermission : secPermissions) {
             if(secPermission != null){
-                secUserSecondary.getSecUserPermissions().add(secPermission);
+                userAccount.getSecUserPermissions().add(secPermission);
             } else {
-                log.error("Error on assing permission to "+secUserSecondary.getUsername());
+                log.error("Error on assing permission to "+userAccount.getUsername());
             }
         }
-        getAccountDao().saveOrUpdate(secUserSecondary);
+        getAccountDao().saveOrUpdate(userAccount);
     }
 
     /**
             final Long groupId,
             final Long userId,
             final String username) throws EnMeDomainNotFoundException {
-        final UserAccount secUserSecondary = getUser(userId); //TODO: I need confirm this user perhaps same group of logged user.
+        final UserAccount userAccount = getUser(userId); //TODO: I need confirm this user perhaps same group of logged user.
         //search group by group id and owner user id.
-        final Group secGroup = getGroupDao().getGroupById(groupId, getUser(username).getSecUser());
+        final Group secGroup = getGroupDao().getGroupById(groupId, getUser(username).getAccount());
         if(secGroup == null){
             throw new EnMeDomainNotFoundException("group not found");
         } else {
             //add new group.
-            secUserSecondary.setSecGroup(secGroup);
-            getAccountDao().saveOrUpdate(secUserSecondary);
+            userAccount.setSecGroup(secGroup);
+            getAccountDao().saveOrUpdate(userAccount);
         }
     }
 
      * @return {@link UnitUserBean}.
      */
     public UnitUserBean singupUser(final SignUpBean singUpBean){
-        final Account secUsers = new Account();
-        getAccountDao().saveOrUpdate(secUsers);
-        final UserAccount secUserSecondary = new UserAccount();
-        secUserSecondary.setUsername(singUpBean.getUsername());
-        secUserSecondary.setPassword(encodingPassword(singUpBean.getPassword()));
-        secUserSecondary.setEnjoyDate(new Date());
-        secUserSecondary.setSecUser(secUsers);
-        secUserSecondary.setUserStatus(Boolean.TRUE);
-        secUserSecondary.setUserEmail(singUpBean.getEmail());
-        secUserSecondary.setCompleteName("");
-        secUserSecondary.setInviteCode(""); //TODO: invite code?
-        getAccountDao().saveOrUpdate(secUserSecondary);
+        final Account account = new Account();
+        getAccountDao().saveOrUpdate(account);
+        final UserAccount userAccount = new UserAccount();
+        userAccount.setUsername(singUpBean.getUsername());
+        userAccount.setPassword(encodingPassword(singUpBean.getPassword()));
+        userAccount.setEnjoyDate(new Date());
+        userAccount.setAccount(account);
+        userAccount.setUserStatus(Boolean.TRUE);
+        userAccount.setUserEmail(singUpBean.getEmail());
+        userAccount.setCompleteName("");
+        userAccount.setInviteCode(""); //TODO: invite code?
+        getAccountDao().saveOrUpdate(userAccount);
         //Add default permissions, if user is signup we should add admin access
         final Set<Permission> permissions = new HashSet<Permission>();
         permissions.add(getPermissionByName(SecurityService.DEFAULT));
         permissions.add(getPermissionByName(SecurityService.OWNER));
         permissions.add(getPermissionByName(SecurityService.PUBLISHER));
         permissions.add(getPermissionByName(SecurityService.EDITOR));
-        this.assingPermission(secUserSecondary, permissions);
+        this.assingPermission(userAccount, permissions);
         //Create login.
         setSpringSecurityAuthentication(singUpBean.getUsername(), singUpBean.getPassword(), permissions);
         if(this.suspendedNotification){
             getServiceMail().sendPasswordConfirmationEmail(singUpBean);
         }
-        log.info("new user "+secUserSecondary.getUsername());
+        log.info("new user "+userAccount.getUsername());
         log.info("Get Authoritie Name"+SecurityContextHolder.getContext().getAuthentication().getName());
-        return ConvertDomainBean.convertSecondaryUserToUserBean(secUserSecondary);
+        return ConvertDomainBean.convertSecondaryUserToUserBean(userAccount);
     }
 
     /**
      */
     public List<UnitTwitterAccountBean> getUserLoggedTwitterAccount(final String username) throws EnMeDomainNotFoundException{
          return ConvertDomainBean.convertListTwitterAccountsToBean(getAccountDao()
-                                 .getTwitterAccountByUser(getUser(username).getSecUser()));
+                                 .getTwitterAccountByUser(getUser(username).getAccount()));
     }
 
     /**
      */
     public List<UnitTwitterAccountBean> getUserLoggedVerifiedTwitterAccount(final String username) throws EnMeDomainNotFoundException{
         return ConvertDomainBean.convertListTwitterAccountsToBean(getAccountDao()
-                                .getTwitterVerifiedAccountByUser(getUser(username).getSecUser()));
+                                .getTwitterVerifiedAccountByUser(getUser(username).getAccount()));
    }
 
     /**

encuestame-business/src/main/java/org/encuestame/business/service/SurveyService.java

             try{
 
                 question.setQuestion(questionBean.getQuestionName());
-                question.setSecUsersQuestion(getAccountDao().getUserById(questionBean.getUserId()));
+                question.setAccountQuestion(getAccountDao().getUserById(questionBean.getUserId()));
                 question.setQidKey(MD5Utils.md5(RandomStringUtils.randomAlphanumeric(SurveyService.RANDOM_QUESTION_KEY)));
                 question.setSharedQuestion(false);
                 //save question
         //	question.setQidKey();
         question.setQuestionPattern(question.getQuestionPattern());
         question.setQuestionsAnswers(question.getQuestionsAnswers());
-        question.setSecUsersQuestion(getAccountDao().getUserById(questionBean.getUserId()));
+        question.setAccountQuestion(getAccountDao().getUserById(questionBean.getUserId()));
        // question.setSharedQuestion();
         this.getQuestionDao().saveOrUpdate(question);
         questionBean.setId(question.getQid());
     public UnitFolder createSurveyFolder(final String folderName, final String username)
             throws EnMeDomainNotFoundException{
         final SurveyFolder surveyFolderDomain = new SurveyFolder();
-        surveyFolderDomain.setUsers(getUser(username).getSecUser());
+        surveyFolderDomain.setUsers(getUser(username).getAccount());
         surveyFolderDomain.setCreatedAt(new Date());
         surveyFolderDomain.setFolderName(folderName);
         this.getSurveyDaoImp().saveOrUpdate(surveyFolderDomain);

encuestame-business/src/main/java/org/encuestame/business/service/TweetPollService.java

                 tPollSwitch.setTweetPoll(tweetPollDomain);
                 tPollSwitch.setCodeTweet(questionsAnswers.getUniqueAnserHash());
                 getTweetPollDao().saveOrUpdate(tPollSwitch);
-                createNotification(NotificationEnum.TWEETPOL_CREATED, question.getQuestion() , question.getSecUsersQuestion());
+                createNotification(NotificationEnum.TWEETPOL_CREATED, question.getQuestion() , question.getAccountQuestion());
             }
             //Save Hash Tags for this tweetPoll.
             log.debug("HashTag Size"+tweetPollBean.getHashTags().size());
      */
     @Deprecated
     public Boolean validateUserTwitterAccount(final String username) throws EnMeDomainNotFoundException{
-        final Account users = getUser(username).getSecUser();
+        final Account users = getUser(username).getAccount();
         Boolean validate = false;
         log.info(users.getTwitterAccount());
         if(!users.getTwitterAccount().isEmpty() && !users.getTwitterPassword().isEmpty()){
      */
     public UnitFolder createTweetPollFolder(final String folderName, final String username) throws EnMeDomainNotFoundException{
         final TweetPollFolder tweetPollFolderDomain = new TweetPollFolder();
-        tweetPollFolderDomain.setUsers(getUser(username).getSecUser());
+        tweetPollFolderDomain.setUsers(getUser(username).getAccount());
         tweetPollFolderDomain.setCreatedAt(new Date());
 
         tweetPollFolderDomain.setFolderName(folderName);

encuestame-business/src/main/java/org/encuestame/business/service/imp/ISecurityService.java

      */
     void setSuspendedNotification(final Boolean suspendedNotification);
 
-     /**
-      * Update Twitter Account.
-      * @param account account
-      * @param password password
-      * @param secUser {@link Account}
-      */
+    /**
+     * Update Twitter Account.
+     * @param accountBean accountBean
+     * @param password password
+     * @param verify verify
+     */
      void updateTwitterAccount(final UnitTwitterAccountBean accountBean, final String password,
                                final Boolean verify);
 

encuestame-business/src/main/java/org/encuestame/business/service/imp/ITwitterService.java

 
     /**
      * Get OAuthorized Token.
-     * @param secUserTwitterAccount {@link SocialAccount}.
+     * @param socialAccount {@link SocialAccount}.
      * @return {@link Twitter}.
      */
-    Twitter getOAuthAuthorizedInstance(final SocialAccount secUserTwitterAccount, final AccessToken accessToken);
+    Twitter getOAuthAuthorizedInstance(final SocialAccount socialAccount, final AccessToken accessToken);
 
     /**
      * Create New OAuth Access Token.
-     * @param secUserTwitterAccount {@link SocialAccount}.
+     * @param socialAccount {@link SocialAccount}.
      * @return {@link AccessToken}.
      */
-    AccessToken createNewOAuthAccessToken(final SocialAccount secUserTwitterAccount);
+    AccessToken createNewOAuthAccessToken(final SocialAccount socialAccount);
 
     /**
      * OAuth Public Tweet.
-     * @param secUserTwitterAccount
+     * @param socialAccount
      * @param tweet
      * @return
      * @throws TwitterException
      */
-    Status publicTweet(final SocialAccount secUserTwitterAccount, final String tweet) throws TwitterException;
+    Status publicTweet(final SocialAccount socialAccount, final String tweet) throws TwitterException;
 }

encuestame-business/src/test/java/org/encuestame/test/business/email/TestCatEmailLists.java

     public void before() {
         this.user = createUser();
         this.secondary = createSecondaryUser("paola", this.user);
-        this.emailList = createDefaultListEmail(this.secondary.getSecUser());
+        this.emailList = createDefaultListEmail(this.secondary.getAccount());
         createDefaultListEmail(this.user, "default");
         this.emails = createDefaultEmails("paola@jotadeveloper.com", this.emailList);
     }

encuestame-business/src/test/java/org/encuestame/test/business/service/TestLocationServices.java

      */
     @Test
     public void testupdateCatLocation() throws EnMeExpcetion{
-        final GeoPoint locationBean = createCatLocation("test", "test", 0, this.secondary.getSecUser());
+        final GeoPoint locationBean = createCatLocation("test", "test", 0, this.secondary.getAccount());
         final UnitLocationBean bean = ConvertDomainBean.convertLocationToBean(locationBean);
         bean.setName("test2");
         this.locationService.updateCatLocation(bean, this.secondary.getUsername());
      */
     @Test
     public void testretrieveLocationSubFolderByUser() throws Exception{
-        final GeoPointFolder locationFolder = createCatLocationFolder(GeoPointFolderType.GROUPING, this.secondary.getSecUser(), "folder", null);
-        createCatLocationFolder(GeoPointFolderType.GROUPING, this.secondary.getSecUser(), "folder sub", locationFolder);
+        final GeoPointFolder locationFolder = createCatLocationFolder(GeoPointFolderType.GROUPING, this.secondary.getAccount(), "folder", null);
+        createCatLocationFolder(GeoPointFolderType.GROUPING, this.secondary.getAccount(), "folder sub", locationFolder);
         final List<UnitLocationFolder> list = this.locationService.retrieveLocationSubFolderByUser(locationFolder.getLocationFolderId(), this.secondary.getUsername());
         Assert.assertEquals(list.size(), 1);
     }
      */
     @Test
     public void testupdateLocationMap() throws Exception{
-        final GeoPointFolder locationFolder = createCatLocationFolder(GeoPointFolderType.GROUPING, this.secondary.getSecUser(), "folder", null);
+        final GeoPointFolder locationFolder = createCatLocationFolder(GeoPointFolderType.GROUPING, this.secondary.getAccount(), "folder", null);
         //final CatLocation location = createCatLocation("Managua", locTypeName, Level, secUsers)
     }
 

encuestame-business/src/test/java/org/encuestame/test/business/service/TestPollService.java

     /** {@link Poll} **/
     private Poll poll;
 
-    private UserAccount secUserSecondary;
+    private UserAccount userAccount;
 
     /** {@link EmailList} **/
     private EmailList emailList;
     @Before
     public void serviceInit(){
         this.user = createUser("testEncuesta", "testEncuesta123");
-        this.secUserSecondary = createSecondaryUser("diana", this.user);
+        this.userAccount = createSecondaryUser("diana", this.user);
         this.question = createQuestion("Why the roses are red?","html");
         this.questionPattern = createQuestionPattern("html");
         this.poll = createPoll(new Date(), this.question, "FDK125", this.user, Boolean.TRUE, Boolean.TRUE);
-        this.emailList = createDefaultListEmail(this.secUserSecondary.getSecUser());
+        this.emailList = createDefaultListEmail(this.userAccount.getAccount());
         createDefaultListEmail(this.user, "default");
         this.emails = createDefaultEmails("paola@jotadeveloper.com", this.emailList);
         createDefaultEmails("dianmorales@gmail.com", this.emailList);
         final UnitQuestionBean question = ConvertDomainBean.convertQuestionsToBean(this.question);
         final UnitPoll unitPoll = ConvertDomainBean.convertPollDomainToBean(this.poll);
         unitPoll.setQuestionBean(question);
-        this.pollService.createPoll(unitPoll, this.secUserSecondary.getUsername(), this.question);
+        this.pollService.createPoll(unitPoll, this.userAccount.getUsername(), this.question);
     }
 
     /**
     public void testgetPollsByFolder() throws EnMeDomainNotFoundException{
         getiPoll().saveOrUpdate(this.poll);
         List<UnitPoll> polls = this.pollService.getPollsByFolder(ConvertDomainBean
-                              .convertFolderToBeanFolder(folder), this.secUserSecondary.getUsername());
+                              .convertFolderToBeanFolder(folder), this.userAccount.getUsername());
         assertEquals(polls.size(), 1);
     }
 
      */
     @Test
     public void testretrieveFolderPoll() throws EnMeDomainNotFoundException{
-        List<UnitFolder> folders = this.pollService.retrieveFolderPoll(this.secUserSecondary.getUsername());
+        List<UnitFolder> folders = this.pollService.retrieveFolderPoll(this.userAccount.getUsername());
         assertEquals(folders.size(), 1);
     }
 
      */
     @Test
     public void testcreatePollFolder() throws EnMeDomainNotFoundException{
-         this.pollService.createPollFolder("folder 2", this.secUserSecondary.getUsername());
-         List<UnitFolder> folders = this.pollService.retrieveFolderPoll(this.secUserSecondary.getUsername());
+         this.pollService.createPollFolder("folder 2", this.userAccount.getUsername());
+         List<UnitFolder> folders = this.pollService.retrieveFolderPoll(this.userAccount.getUsername());
          assertEquals(folders.size(), 2);
     }
 
      */
     @Test
     public void testupdateFolderName() throws EnMeDomainNotFoundException{
-        this.pollService.updateFolderName(this.folder.getId(), "newFolderName", this.secUserSecondary.getUsername());
+        this.pollService.updateFolderName(this.folder.getId(), "newFolderName", this.userAccount.getUsername());
         final PollFolder folder = this.getiPoll().getPollFolderById(this.folder.getId());
          assertEquals(folder.getFolderName(), "newFolderName");
     }
     @Test
     public void testFindAllPollByUserId() throws EnMeDomainNotFoundException{
         List<UnitPoll> unitPoll =  new ArrayList<UnitPoll>();
-        unitPoll = pollService.listPollByUser(this.secUserSecondary.getUsername(), 5, 0);
+        unitPoll = pollService.listPollByUser(this.userAccount.getUsername(), 5, 0);
          assertEquals("should be equals",1, unitPoll.size());
     }
 
     public void testListPollbyQuestionKeyword() throws EnMeDomainNotFoundException{
         List<UnitPoll> unitPollList = new ArrayList<UnitPoll>();
         final String keyword = "Why";
-        unitPollList = pollService.listPollbyQuestionKeyword(this.secUserSecondary.getUsername(), keyword, 5, 0);
+        unitPollList = pollService.listPollbyQuestionKeyword(this.userAccount.getUsername(), keyword, 5, 0);
         assertEquals("should be equals",1, unitPollList.size());
 
     }
     @Test
     public void testCreateUrlPoll(){
            final String hashUrl="3456DS";
-           final String testUrl= pollService.createUrlPoll(URLPOLL, hashUrl, this.secUserSecondary.getCompleteName());
+           final String testUrl= pollService.createUrlPoll(URLPOLL, hashUrl, this.userAccount.getCompleteName());
            assertNotNull(testUrl);
     }
 
     @Test(timeout=80000)
     public void testPublicPollByEmailList(){
         final UnitLists emailUnitList = createUnitEmailList(this.emailList.getIdList(),
-                        new Date(), this.emailList.getListName(), this.secUserSecondary.getUid());
-         final String urlPoll = pollService.createUrlPoll(URLPOLL, "DS56727", this.secUserSecondary.getCompleteName());
+                        new Date(), this.emailList.getListName(), this.userAccount.getUid());
+         final String urlPoll = pollService.createUrlPoll(URLPOLL, "DS56727", this.userAccount.getCompleteName());
          pollService.publicPollByList(urlPoll, emailUnitList);
          pollService.publicPollByList(urlPoll, new UnitLists());
          assertEquals(1, 1);

encuestame-business/src/test/java/org/encuestame/test/business/service/TestTweetPollService.java

     private Account user;
 
     /** {@link UserAccount}. **/
-    private UserAccount secUserSecondary;
+    private UserAccount userAccount;
 
     private List<UnitAnswersBean> answers;
 
    @Before
    public void serviceInit(){
         this.user = createUser("testEncuesta", "testEncuesta123");
-        this.secUserSecondary = createSecondaryUser("jhon", user);
+        this.userAccount = createSecondaryUser("jhon", user);
         this.question = createQuestion("Why the sky is blue?","html");
         this.pattern = createQuestionPattern("html");
         createQuestionAnswer("Yes", this.question,"SSSA");
 
     @Test
     public void testPublicMultiplesTweetAccounts(){
-            createDefaultSettedTwitterAccount(this.secUserSecondary.getSecUser());
-            final List<SocialAccount> list = getSecUserDao().getTwitterAccountByUser(this.secUserSecondary.getSecUser());
+            createDefaultSettedTwitterAccount(this.userAccount.getAccount());
+            final List<SocialAccount> list = getSecUserDao().getTwitterAccountByUser(this.userAccount.getAccount());
             final List<UnitTwitterAccountBean> listUnitTwitterAccount = ConvertDomainBean.convertListTwitterAccountsToBean(list);
              final String tweetText = RandomStringUtils.randomAlphabetic(5);
             final TweetPoll tweetPoll = createTweetPollPublicated(true, true, new Date(), this.user, question);

encuestame-core/src/main/java/org/encuestame/core/util/ConvertDomainBean.java

         final UnitQuestionBean questionBean = new UnitQuestionBean();
         questionBean.setId(questions.getQid());
         questionBean.setQuestionName(questions.getQuestion());
-        questionBean.setUserId(questions.getSecUsersQuestion().getUid());
+        questionBean.setUserId(questions.getAccountQuestion().getUid());
         return questionBean;
     }
 

encuestame-mvc/src/main/java/org/encuestame/mvc/controller/json/TwitterAccountJsonController.java

 import org.codehaus.jackson.map.JsonMappingException;
 import org.encuestame.mvc.controller.AbstractJsonController;
 import org.encuestame.utils.security.UnitTwitterAccountBean;
-import org.encuestame.web.beans.survey.tweetpoll.TwitterAccountsPublicationBean;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 
 /**
  * Twitter Service Json Controller.

encuestame-mvc/src/main/java/org/encuestame/mvc/controller/json/notifications/NotificationsJsonController.java

             HttpServletResponse response) throws JsonGenerationException, JsonMappingException, IOException {
         final Map<String, Object> responseJson = new HashMap<String, Object>();
         final UserAccount secondary = getByUsername(getUserPrincipalUsername());
-        final Long totalNot = getNotificationDao().retrieveTotalNotificationStatus(secondary.getSecUser());
-        final Long totalNewNot = getNotificationDao().retrieveTotalNotReadedNotificationStatus(secondary.getSecUser());
+        final Long totalNot = getNotificationDao().retrieveTotalNotificationStatus(secondary.getAccount());
+        final Long totalNewNot = getNotificationDao().retrieveTotalNotReadedNotificationStatus(secondary.getAccount());
         responseJson.put("t", totalNot);
         responseJson.put("n", totalNewNot);
         setItemResponse(responseJson);
              setError("user not found", response);
          }
          final Map<String, Object> responseJson = new HashMap<String, Object>();
-         final List<Notification> notifications = getNotificationDao().loadNotificationByUserAndLimit(secondary.getSecUser(), limit);
+         final List<Notification> notifications = getNotificationDao().loadNotificationByUserAndLimit(secondary.getAccount(), limit);
          final List<UtilNotification> utilNotifications = new ArrayList<UtilNotification>();
          for (Notification notification : notifications) {
              final UtilNotification utilNotification = new UtilNotification();

encuestame-mvc/src/main/java/org/encuestame/mvc/controller/json/survey/TweetPollJsonController.java

                 //save question
                   final Question questionDomain = getSurveyService().createQuestion(questionBean);
                 // save create tweet poll
-                    tweetPoll.setUserId(user.getSecUser().getUid());
+                    tweetPoll.setUserId(user.getAccount().getUid());
                     tweetPoll.setCloseNotification(Boolean.FALSE);
                     tweetPoll.setResultNotification(Boolean.FALSE);
                     tweetPoll.setPublishPoll(Boolean.TRUE); //always TRUE

encuestame-mvc/src/test/java/org/encuestame/mvc/test/json/NotificationJsonServiceTestCase.java

      */
     @Before
     public void initTest() {
-       notification = createNotification("test notification", getSecondary().getSecUser(),
+       notification = createNotification("test notification", getSecondary().getAccount(),
                 NotificationEnum.PROJECT_CREATED);
-        createNotification("test notification", getSecondary().getSecUser(),
+        createNotification("test notification", getSecondary().getAccount(),
                 NotificationEnum.TWEETPOL_CREATED);
     }
 
         final JSONObject response = callJsonService();
         final JSONObject sucess = getSucess(response);
         JSONArray listNotifications = (JSONArray) sucess.get("notifications");
-        final List<Notification> list = getNotification().loadNotificationByUserAndLimit(getSecondary().getSecUser(), 100);
+        final List<Notification> list = getNotification().loadNotificationByUserAndLimit(getSecondary().getAccount(), 100);
         Assert.assertEquals(list.size(), listNotifications.size());
         initService("/api/notifications.json", MethodJson.GET);
         setParameter("limit", "1");

encuestame-mvc/src/test/java/org/encuestame/mvc/test/json/TweetPollJsonDataChartTestCase.java

      */
     @Before
     public void init(){
-        final Question question = createQuestion("Real Madrid or Barcelona?", getSecondary().getSecUser());
-        this.tweetPoll = createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getSecUser(), question);
+        final Question question = createQuestion("Real Madrid or Barcelona?", getSecondary().getAccount());
+        this.tweetPoll = createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getAccount(), question);
         final QuestionAnswer questionsAnswers1 = createQuestionAnswer("Yes", question, "hash1");
         final QuestionAnswer questionsAnswers2 = createQuestionAnswer("No", question, "hash2");
         this.answer1 = createTweetPollSwitch(questionsAnswers1, tweetPoll);

encuestame-mvc/src/test/java/org/encuestame/mvc/test/syndication/TweetPollFeedControllerTestCase.java

     public void initView(){
         Assert.assertNotNull(this.tweetPollAtomFeedView);
         Assert.assertNotNull(this.tweetPollRssFeedView);
-        final Question question = createQuestion("Real Madrid or Barcelona?", getSecondary().getSecUser());
-        final Question question1 = createQuestion("Real Madrid or Barcelona?", getSecondary().getSecUser());
-        final Question question2 = createQuestion("Real Madrid or Barcelona?", getSecondary().getSecUser());
-        final Question question3 = createQuestion("Real Madrid or Barcelona?", getSecondary().getSecUser());
-        this.tweetPoll = createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getSecUser(), question);
-        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getSecUser(), question1);
-        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getSecUser(), question2);
-        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getSecUser(), question3);
+        final Question question = createQuestion("Real Madrid or Barcelona?", getSecondary().getAccount());
+        final Question question1 = createQuestion("Real Madrid or Barcelona?", getSecondary().getAccount());
+        final Question question2 = createQuestion("Real Madrid or Barcelona?", getSecondary().getAccount());
+        final Question question3 = createQuestion("Real Madrid or Barcelona?", getSecondary().getAccount());
+        this.tweetPoll = createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getAccount(), question);
+        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getAccount(), question1);
+        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getAccount(), question2);
+        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), getSecondary().getAccount(), question3);
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/ApplicationDao.java

 import org.encuestame.persistence.dao.IApplicationDao;
 import org.encuestame.persistence.domain.application.Application;
 import org.encuestame.persistence.domain.application.ApplicationConnection;
-import org.encuestame.persistence.domain.security.Account;
 import org.encuestame.persistence.domain.security.UserAccount;
 import org.encuestame.persistence.exception.EnMeDomainNotFoundException;
 import org.encuestame.persistence.utils.SecureRandomStringKeyGenerator;
-import org.hibernate.HibernateException;
 import org.hibernate.SessionFactory;
 import org.hibernate.criterion.DetachedCriteria;
 import org.hibernate.criterion.Restrictions;
      * @param application
      * @return
      */
+    @SuppressWarnings("unchecked")
     public ApplicationConnection searchConnectionByAppIdAndUserId(
             final UserAccount account, final Application application){
          final DetachedCriteria criteria = DetachedCriteria.forClass(ApplicationConnection.class);

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/GeoPointDao.java

  * @since  6/05/2009 14:45:54
  * @version $Id$
  */
-@Repository(value = "geoPointDao") 
+@Repository(value = "geoPointDao")
 public class GeoPointDao extends AbstractHibernateDaoSupport implements IGeoPoint {
 
-	@Autowired
-	public GeoPointDao(SessionFactory sessionFactory) {
-	 		setSessionFactory(sessionFactory);
+    @Autowired
+    public GeoPointDao(SessionFactory sessionFactory) {
+             setSessionFactory(sessionFactory);
     }
-	
+
     /**
      * Find All Location.
      * @return list of all locations
     @SuppressWarnings("unchecked")
     public GeoPoint getLocationById(final Long locateId, final Long userId) {
         final DetachedCriteria criteria = DetachedCriteria.forClass(GeoPoint.class);
-        criteria.add(Restrictions.eq("secUsers.uid", userId));
+        criteria.add(Restrictions.eq("account.uid", userId));
         criteria.add(Restrictions.eq("locateId", locateId));
         return (GeoPoint) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
     }
     @SuppressWarnings("unchecked")
     public List<GeoPointFolder> getLocationFolders(final Long userId){
          final DetachedCriteria criteria = DetachedCriteria.forClass(GeoPointFolder.class);
-         criteria.add(Restrictions.eq("secUsers.id", userId));
+         criteria.add(Restrictions.eq("account.id", userId));
          criteria.add(Restrictions.isNull("subLocationFolder"));
          return getHibernateTemplate().findByCriteria(criteria);
     }
     @SuppressWarnings("unchecked")
     public List<GeoPointFolder> getLocationFoldersByLocationFolderId(final Long locationFolderId, final Long userId){
         final DetachedCriteria criteria = DetachedCriteria.forClass(GeoPointFolder.class);
-        criteria.add(Restrictions.eq("secUsers.id", userId));
+        criteria.add(Restrictions.eq("account.id", userId));
         criteria.add(Restrictions.eq("subLocationFolder.locationFolderId", locationFolderId));
         criteria.add(Restrictions.isNotNull("subLocationFolder"));
         return getHibernateTemplate().findByCriteria(criteria);
     public List<GeoPoint> getLocationByFolder(final Long locationFolderId, final Long userId){
          final DetachedCriteria criteria = DetachedCriteria.forClass(GeoPoint.class);
          criteria.add(Restrictions.eq("catLocationFolder.id", locationFolderId));
-         criteria.add(Restrictions.eq("secUsers.uid", userId));
+         criteria.add(Restrictions.eq("account.uid", userId));
          return getHibernateTemplate().findByCriteria(criteria);
     }
 
     @SuppressWarnings("unchecked")
     public List<GeoPoint> getLocationByUser(final Long userId){
         final DetachedCriteria criteria = DetachedCriteria.forClass(GeoPoint.class);
-        criteria.add(Restrictions.eq("secUsers.uid", userId));
+        criteria.add(Restrictions.eq("account.uid", userId));
         return getHibernateTemplate().findByCriteria(criteria);
    }
 
     public GeoPointFolder getLocationFolderByIdAndUserId(final Long locationFolderId, final Long userId){
         final DetachedCriteria criteria = DetachedCriteria.forClass(GeoPointFolder.class);
         criteria.add(Restrictions.eq("locationFolderId", locationFolderId));
-        criteria.add(Restrictions.eq("secUsers.uid", userId));
+        criteria.add(Restrictions.eq("account.uid", userId));
         return (GeoPointFolder) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
    }
 

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/GroupDaoImp.java

      * @return list of groups.
      */
     @SuppressWarnings("unchecked")
-    public List<Group> loadGroupsByUser(final Account secUsers) {
-        return getHibernateTemplate().findByNamedParam("from Group where secUsers = :secUsers ", "secUsers", secUsers);
+    public List<Group> loadGroupsByUser(final Account user) {
+        return getHibernateTemplate().findByNamedParam("from Group where account = :user ", "user", user);
     }
 
     /**
     @SuppressWarnings("unchecked")
     public Group getGroupById(final Long groupId, final Account secUser){
         return (Group) DataAccessUtils.uniqueResult(getHibernateTemplate()
-               .findByNamedParam("from Group where groupId = :groupId and  secUsers = :secUser",
-                new String[]{"groupId", "secUser"}, new Object[]{groupId, secUser}));
+               .findByNamedParam("from Group where groupId = :groupId and  account = :account",
+                new String[]{"groupId", "account"}, new Object[]{groupId, secUser}));
     }
 
     /**
     @SuppressWarnings("unchecked")
     public Group getGroupByIdandUser(final Long groupId, final Long userId){
          final DetachedCriteria criteria = DetachedCriteria.forClass(Group.class);
-         criteria.createAlias("secUsers", "secUsers");
-         criteria.add(Restrictions.eq("secUsers.uid", userId));
+         criteria.createAlias("account", "account");
+         criteria.add(Restrictions.eq("account.uid", userId));
          criteria.add(Restrictions.eq("tweetPollId", groupId));
          return (Group) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
     }
          return getHibernateTemplate().findByNamedParam("SELECT sg.groupName, COUNT(scu.secGroup.groupId) "
                                                          + "FROM UserAccount as scu, Group as sg "
                                                          + "WHERE scu.secGroup.groupId = sg.groupId AND "
-                                                         + "scu.secUser = :secUser "
-                                                         + "GROUP BY sg.groupName", "secUser", user);
+                                                         + "scu.account = :account "
+                                                         + "GROUP BY sg.groupName", "account", user);
     }
 
     /**
         return getHibernateTemplate().findByNamedParam("SELECT sg.groupName, COUNT(scu.secGroup.groupId) "
                                                         + "FROM UserAccount as scu, Group as sg "
                                                         + "WHERE scu.secGroup.groupId = sg.groupId AND "
-                                                        + "scu.secUser.uid = :secUser "
-                                                        + "GROUP BY sg.groupName", "secUser", user);
+                                                        + "scu.account.uid = :account "
+                                                        + "GROUP BY sg.groupName", "account", user);
    }
 }

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/NotificationDao.java

 @Repository("notificationDao")
 public class NotificationDao extends AbstractHibernateDaoSupport implements INotification{
 
-	@Autowired
-	public NotificationDao(SessionFactory sessionFactory) {
-	 		setSessionFactory(sessionFactory);
+    @Autowired
+    public NotificationDao(SessionFactory sessionFactory) {
+             setSessionFactory(sessionFactory);
     }
-	
+
     /**
      * Load Notifications By {@link Account} and Limit. This method add all notifications without User (global)
      * @param secUser {@link Account}
      * @return
      */
     @SuppressWarnings("unchecked")
-    public List<Notification> loadNotificationByUserAndLimit(final Account secUser, final Integer limit){
+    public List<Notification> loadNotificationByUserAndLimit(final Account user, final Integer limit){
          final DetachedCriteria criteria = DetachedCriteria.forClass(Notification.class);
-            criteria.add(Restrictions.or(Restrictions.eq("secUser", secUser), Restrictions.isNull("secUser")));
+            criteria.add(Restrictions.or(Restrictions.eq("account", user), Restrictions.isNull("account")));
             criteria.addOrder(Order.desc("created"));
             return getHibernateTemplate().findByCriteria(criteria, 0, limit);
     }
      */
     public Long retrieveTotalNotificationStatus(final Account secUser){
         return retrieveCountNotification(secUser, "select count(*) from Notification "
-                +" WHERE secUser = :user");
+                +" WHERE account = :secUser");
     }
 
     /**
      * @return
      */
     @SuppressWarnings("unchecked")
-    public Long retrieveTotalNotReadedNotificationStatus(final Account secUser){
-        return retrieveCountNotification(secUser ,"select count(*) from Notification "
-                +" WHERE secUser = :user AND readed = false");
+    public Long retrieveTotalNotReadedNotificationStatus(final Account user){
+        return retrieveCountNotification(user ,"select count(*) from Notification "
+                +" WHERE account = :user AND readed = false");
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/QuestionDaoImp.java

                             final org.apache.lucene.search.Query query = parser.parse(keyword);
                             final FullTextQuery hibernateQuery = fullTextSession.createFullTextQuery(query, Question.class);
                             final Criteria criteria = session.createCriteria(Question.class);
-                            criteria.createAlias("secUsersQuestion", "secUsersQuestion");
-                            criteria.add(Restrictions.eq("secUsersQuestion.uid", userId));
+                            criteria.createAlias("accountQuestion", "accountQuestion");
+                            criteria.add(Restrictions.eq("accountQuestion.uid", userId));
                             hibernateQuery.setCriteriaQuery(criteria);
                             final List<Question> result = hibernateQuery.list();
                             log.info("result LUCENE "+result.size());

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/SocialProviderDao.java

 
 import org.encuestame.persistence.dao.ISocialProviderDao;
 import org.encuestame.persistence.domain.security.SocialAccountProvider;
-import org.encuestame.persistence.domain.security.UserAccount;
 import org.hibernate.SessionFactory;
 import org.hibernate.criterion.DetachedCriteria;
 import org.hibernate.criterion.Restrictions;
      * @param socialName name
      * @return
      */
+    @SuppressWarnings("unchecked")
     public SocialAccountProvider getSocialAccountProviderId(final String socialName) {
         final DetachedCriteria criteria = DetachedCriteria.forClass(SocialAccountProvider.class);
         criteria.add(Restrictions.eq("name", socialName) );

encuestame-persistence/src/main/java/org/encuestame/persistence/domain/GeoPoint.java

     private Integer locationAccuracy;
 
     /** User. **/
-    private Account secUsers;
+    private Account account;
 
     /** Location Folder. **/
     private GeoPointFolder catLocationFolder;
      * @return the secUsers
      */
     @ManyToOne()
-    public Account getSecUsers() {
-        return secUsers;
+    public Account getAccount() {
+        return account;
     }
 
     /**
-     * @param secUsers the secUsers to set
+     * @param account the account to set
      */
-    public void setSecUsers(Account secUsers) {
-        this.secUsers = secUsers;
+    public void setAccount(Account account) {
+        this.account = account;
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/domain/GeoPointFolder.java

     /**
      * {@link Account}.
      */
-    private Account secUsers;
+    private Account account;
 
     /**
      * SubLocation Folder.
     }
 
     /**
-     * @return the secUsers
+     * @return the account
      */
     @ManyToOne()
-    public Account getSecUsers() {
-        return secUsers;
+    public Account getAccount() {
+        return account;
     }
 
     /**
-     * @param secUsers the secUsers to set
+     * @param account the account to set
      */
-    public void setSecUsers(final Account secUsers) {
-        this.secUsers = secUsers;
+    public void setAccount(final Account account) {
+        this.account = account;
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/domain/Question.java

     private String qidKey;
     private Boolean sharedQuestion;
     private QuestionPattern questionPattern;
-    private Account secUsersQuestion;
+    private Account accountQuestion;
     private Set<QuestionColettion> questionColettions = new HashSet<QuestionColettion>();
 
     /** {@link QuestionAnswer}. **/
      */
     @ManyToOne()
     @JoinColumn(name = "uid", nullable = false)
-    public Account getSecUsersQuestion() {
-        return secUsersQuestion;
+    public Account getAccountQuestion() {
+        return accountQuestion;
     }
 
     /**
      * @param secUsersQuestion the secUsersQuestion to set
      */
-    public void setSecUsersQuestion(final Account secUsersQuestion) {
-        this.secUsersQuestion = secUsersQuestion;
+    public void setAccountQuestion(final Account accountQuestion) {
+        this.accountQuestion = accountQuestion;
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/domain/notifications/Notification.java

 
     private String additionalDescription;
 
-    private Account secUser;
+    private Account account;
 
     private Date created = Calendar.getInstance().getTime();
 
      */
     @ManyToOne(cascade = CascadeType.MERGE)
     @JoinColumn(name = "uid", nullable = false)
-    public Account getSecUser() {
-        return secUser;
+    public Account getAccount() {
+        return account;
     }
 
     /**
      * @param secUser
      *            the secUser to set
      */
-    public void setSecUser(Account secUser) {
-        this.secUser = secUser;
+    public void setAccount(Account account) {
+        this.account = account;
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/domain/security/Group.java

     /**
      * {@link Account}.
      */
-    private Account secUsers = new Account();
+    private Account account = new Account();
 
     /**
      * @return groupId
      * @return the secUsers
      */
     @ManyToOne()
-    public Account getSecUsers() {
-        return secUsers;
+    public Account getAccount() {
+        return account;
     }
 
     /**
      * @param secUsers the secUsers to set
      */
-    public void setSecUsers(final Account secUsers) {
-        this.secUsers = secUsers;
+    public void setAccount(final Account account) {
+        this.account = account;
     }
 
     /**

encuestame-persistence/src/main/java/org/encuestame/persistence/domain/security/UserAccount.java

     private String userEmail;
     private String username;
     private String password;
-    private Account secUser;
+    private Account account;
     private String inviteCode;
     private Date enjoyDate;
     private Boolean userStatus;
      * @return the secUser
      */
     @ManyToOne()
-    public Account getSecUser() {
-        return secUser;
+    public Account getAccount() {
+        return account;
     }
 
     /**
      * @param secUser the secUser to set
      */
-    public void setSecUser(Account secUser) {
-        this.secUser = secUser;
+    public void setAccount(Account account) {
+        this.account = account;
     }
 
     /**

encuestame-persistence/src/test/java/org/encuestame/test/config/AbstractBase.java

         user.setUserEmail(email);
         user.setEnjoyDate(new Date());
         user.setInviteCode("xxxxxxx");
-        user.setSecUser(secUser);
+        user.setAccount(secUser);
         user.setUserStatus(true);
         getSecUserDao().saveOrUpdate(user);
         return user;
         user.setUserEmail(email);
         user.setEnjoyDate(new Date());
         user.setInviteCode("xxxxxxx");
-        user.setSecUser(secUser);
+        user.setAccount(secUser);
         user.setUserStatus(true);
         user.setSecGroup(secGroup);
         getSecUserDao().saveOrUpdate(user);
         location.setLocationStatus(Status.ACTIVE);
         location.setLocationDescription(locDescription);
         location.setLocationLatitude(2F);
-        location.setSecUsers(secUsers);
+        location.setAccount(secUsers);
         location.setCatLocationFolder(catLocationFolder);
         location.setLocationLongitude(3F);
         location.setTidtype(createCatLocationType(locTypeName));
 
     public Group createGroups(final String groupname, final Account secUser){
         final Group group = new Group();
-        group.setSecUsers(secUser);
+        group.setAccount(secUser);
         group.setGroupName(groupname);
         group.setIdState(1L);
         group.setGroupType(Type.SECURITY);
         questions.setQidKey("1");
         questions.setQuestion(question);
         questions.setQuestionPattern(createQuestionPattern(patron));
-        questions.setSecUsersQuestion(createUser());
+        questions.setAccountQuestion(createUser());
         getQuestionDaoImp().saveOrUpdate(questions);
         return questions;
     }
      */
     public Question createQuestion(final String questionName, final Account user){
         final Question question =  createQuestion(questionName, "patter");
-        question.setSecUsersQuestion(user);
+        question.setAccountQuestion(user);
         getQuestionDaoImp().saveOrUpdate(question);
         //log.info("user assigned "+question.getSecUsersQuestion().getUid());
         return question;
     public Question createQuestion(final String question, final String patron, final Account user){
         final Question questions = new Question();
         questions.setQidKey("1");
-        questions.setSecUsersQuestion(user);
+        questions.setAccountQuestion(user);
         questions.setQuestion(question);
         questions.setQuestionPattern(createQuestionPattern(patron));
         getQuestionDaoImp().saveOrUpdate(questions);
         final Question question = createQuestion("who I am?", "");
         final QuestionAnswer questionsAnswers1 = createQuestionAnswer("yes", question, "12345");
         final QuestionAnswer questionsAnswers2 = createQuestionAnswer("no", question, "12346");
-        final TweetPoll tweetPoll = createPublishedTweetPoll(secondary.getSecUser(), question);
+        final TweetPoll tweetPoll = createPublishedTweetPoll(secondary.getAccount(), question);
         final TweetPollSwitch pollSwitch1 = createTweetPollSwitch(questionsAnswers1, tweetPoll);
         final TweetPollSwitch pollSwitch2 = createTweetPollSwitch(questionsAnswers2, tweetPoll);
         createTweetPollResult(pollSwitch1, "192.168.0.1");
         final GeoPointFolder catLocationFolder = new GeoPointFolder();
         catLocationFolder.setFolderType(type);
         catLocationFolder.setLocationFolderName(folderName);
-        catLocationFolder.setSecUsers(secUsers);
+        catLocationFolder.setAccount(secUsers);
         catLocationFolder.setSubLocationFolder(locationFolder);
         getCatLocationDao().saveOrUpdate(catLocationFolder);
         return catLocationFolder;
          notification.setCreated(new Date());
          notification.setDescription(description);
          notification.setReaded(Boolean.FALSE);
-         notification.setSecUser(secUser);
+         notification.setAccount(secUser);
          getNotification().saveOrUpdate(notification);
          return notification;
     }

encuestame-persistence/src/test/java/org/encuestame/test/persistence/dao/TestProjectDaoImp.java

     @Before
     public void initService(){
         user  = createSecondaryUser("user 1", createUser());
-        project = createProject("project 1","TIC Project","Project", user.getSecUser());
+        project = createProject("project 1","TIC Project","Project", user.getAccount());
 
     }
     /**
      * Test Add Locations to Project.
      */
     public void testGetProjectByLocationId(){
-        final GeoPoint loc1 = createCatLocation("managua", "mga", 1, this.user.getSecUser());
-        final GeoPoint loc2 = createCatLocation("diriomo", "drm", 1, this.user.getSecUser());
+        final GeoPoint loc1 = createCatLocation("managua", "mga", 1, this.user.getAccount());
+        final GeoPoint loc2 = createCatLocation("diriomo", "drm", 1, this.user.getAccount());
         project.getLocations().add(loc1);
         project.getLocations().add(loc2);
         getProjectDaoImp().saveOrUpdate(project);
      */
     @Test
     public void testFindProjectsByUserID(){
-        createProject("encuestame", "survey system", "the best", user.getSecUser());
-        final List<Project> projectList = getProjectDaoImp().findProjectsByUserID(user.getSecUser().getUid());
+        createProject("encuestame", "survey system", "the best", user.getAccount());
+        final List<Project> projectList = getProjectDaoImp().findProjectsByUserID(user.getAccount().getUid());
         assertEquals("Should be equals", 2, projectList.size());
     }
 

encuestame-persistence/src/test/java/org/encuestame/test/persistence/dao/TestQuestionDao.java

  * @since Feb 14, 2010 12:18:42 AM
  * @version $Id$
  */
-@SuppressWarnings("deprecation")
 public class TestQuestionDao extends AbstractBase{
 
     /** {@link Account} **/

encuestame-persistence/src/test/java/org/encuestame/test/persistence/dao/TestTweetPollDao.java

       final Question question = createQuestion("who I am?", "");
       this.questionsAnswers1 = createQuestionAnswer("yes", question, "12345");
       this.questionsAnswers2 = createQuestionAnswer("no", question, "12346");
-      this.tweetPoll = createPublishedTweetPoll(secondary.getSecUser(), question);
+      this.tweetPoll = createPublishedTweetPoll(secondary.getAccount(), question);
       this.pollSwitch1 = createTweetPollSwitch(questionsAnswers1, tweetPoll);
       this.pollSwitch2 = createTweetPollSwitch(questionsAnswers2, tweetPoll);
       createTweetPollResult(pollSwitch1, "192.168.0.1");
       createTweetPollResult(pollSwitch2, "192.168.0.3");
       createTweetPollResult(pollSwitch2, "192.168.0.4");
 
-      this.tweetPollFolder = createTweetPollFolder("First TweetPoll Folder", secondary.getSecUser());
+      this.tweetPollFolder = createTweetPollFolder("First TweetPoll Folder", secondary.getAccount());
 
     }
 
     public void testGetTweetPollByIdandUserId(){
         assertNotNull(tweetPoll);
         assertNotNull(secondary);
-        final TweetPoll tp = getTweetPoll().getTweetPollByIdandUserId(this.tweetPoll.getTweetPollId(), secondary.getSecUser().getUid());
+        final TweetPoll tp = getTweetPoll().getTweetPollByIdandUserId(this.tweetPoll.getTweetPollId(), secondary.getAccount().getUid());
         assertEquals("Should be equals", 1, 1);
         assertEquals("Should be equals", this.tweetPoll.getTweetPollId(), tp.getTweetPollId());
     }
     @Test
     public void testGetTweetPollFolderByIdandUser(){
         assertNotNull(this.tweetPollFolder);
-        final TweetPollFolder tpf = getTweetPoll().getTweetPollFolderByIdandUser(this.tweetPollFolder.getId(), secondary.getSecUser().getUid());
+        final TweetPollFolder tpf = getTweetPoll().getTweetPollFolderByIdandUser(this.tweetPollFolder.getId(), secondary.getAccount().getUid());
         assertEquals("Should be equals", this.tweetPollFolder.getId(), tpf.getId());
      }
 
     public void testRetrieveTweetPollFolderByUserId(){
         assertNotNull(tweetPollFolder);
         assertNotNull(secondary);
-        final List<TweetPollFolder> tpfu = getTweetPoll().retrieveTweetPollFolderByUserId(this.secondary.getSecUser().getUid());
+        final List<TweetPollFolder> tpfu = getTweetPoll().retrieveTweetPollFolderByUserId(this.secondary.getAccount().getUid());
         assertEquals("Should be equals", 1, tpfu.size());
     }
 
      */
     @Test
     public void testRetrieveTweetPollByFolder() throws EnMeDomainNotFoundException {
-        final Long user = this.secondary.getSecUser().getUid();
+        final Long user = this.secondary.getAccount().getUid();
         assertNotNull(tweetPollFolder);
         assertNotNull(tweetPoll);
         final TweetPoll addTweetPoll = addTweetPollToFolder(this.tweetPollFolder.getId(), user, this.tweetPoll.getTweetPollId());
     public void testRetrieveTweetsByUserId(){
         assertNotNull(this.secondary);
         assertNotNull(tweetPoll);
-        final Long userId = this.secondary.getSecUser().getUid();
+        final Long userId = this.secondary.getAccount().getUid();
         final List<TweetPoll> tweets = getTweetPoll().retrieveTweetsByUserId(userId, 5, 0);
         assertEquals("Should be equals", 1, tweets.size());
     }
     public void testRetrieveTweetsByQuestionName(){
         assertNotNull(this.secondary);
         assertNotNull(tweetPoll);
-        final Long userId = this.secondary.getSecUser().getUid();
+        final Long userId = this.secondary.getAccount().getUid();
         final String keyword = "Who";
         final List<TweetPoll> tweets = getTweetPoll().retrieveTweetsByQuestionName(keyword, userId, 5, 0);
         assertEquals("Should be equals", 1, tweets.size());
     public void testRetrieveTweetPollToday(){
         assertNotNull(this.secondary);
         assertNotNull(tweetPoll);
-        final Long userId = this.secondary.getSecUser().getUid();
+        final Long userId = this.secondary.getAccount().getUid();
         final List<TweetPoll> tweetsToday = getTweetPoll().retrieveTweetPollToday(userId, 5, 0);
         assertEquals("Should be equals", 1, tweetsToday.size());
     }
     public void testRetrieveTweetPollByDate(){
         assertNotNull(this.secondary);
         assertNotNull(tweetPoll);
-        final Long userId = this.secondary.getSecUser().getUid();
+        final Long userId = this.secondary.getAccount().getUid();
         final Date initDate = new Date();
         final List<TweetPoll> tweetsByDate = getTweetPoll().retrieveTweetPollByDate(userId, initDate, 5, 0);
         assertEquals("Should be equals", 1, tweetsByDate.size());
     public void testRetrieveFavouritesTweetPoll(){
         assertNotNull(this.secondary);
         assertNotNull(tweetPoll);