Author: echatellier Date: 2014-07-09 16:41:50 +0200 (Wed, 09 Jul 2014) New Revision: 375 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/375 Log: Return entity without making binding copy (hibernate can't handle copy, just original) Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-07-09 12:55:59 UTC (rev 374) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-07-09 14:41:50 UTC (rev 375) @@ -185,13 +185,9 @@ if (userConnect.isConnected()) { // update in database - FaxToMailUser user = updateUserFormLdap(searchEntry, login); + result = updateUserFormLdap(searchEntry, login); getPersistenceContext().commit(); - - // return copy without sensible informations - Binder<FaxToMailUser, FaxToMailUser> faxToMailUserBinder = BinderFactory.newBinder(FaxToMailUser.class); - result = new FaxToMailUserImpl(); - faxToMailUserBinder.copyExcluding(user, result); + userConnect.close(); } else { throw new AuthenticationException("Not connected"); @@ -246,13 +242,9 @@ if( searchEntry != null ) { // update in database - FaxToMailUser user = updateUserFormLdap(searchEntry, login); + result = updateUserFormLdap(searchEntry, login); getPersistenceContext().commit(); - // return copy without sensible informations - Binder<FaxToMailUser, FaxToMailUser> faxToMailUserBinder = BinderFactory.newBinder(FaxToMailUser.class); - result = new FaxToMailUserImpl(); - faxToMailUserBinder.copyExcluding(user, result); } else { throw new AuthenticationException("Utilisateur inconnu : " + login); } @@ -324,6 +316,10 @@ } else { user = faxtomailUserDao.create(user); } + + // force collection loading to force non lazy collections + user.isAffectedFoldersEmpty(); + user.isUserGroupsEmpty(); return user; }
participants (1)
-
echatellier@users.forge.codelutin.com