public Long updateLdapConfig(Long ldapConfigId, String name, Boolean addDomainToUserName,
String configFileName, String domain, Long updatedby, Boolean isActive) {
try {
LdapConfig ldapConfig = this.getLdapConfigById(ldapConfigId);
if (ldapConfig == null) {
return -1L;
}
ldapConfig.setAddDomainToUserName(addDomainToUserName);
ldapConfig.setConfigFileName(configFileName);
ldapConfig.setDeleted("false");
ldapConfig.setDomain(domain);
ldapConfig.setIsActive(isActive);
ldapConfig.setName(name);
ldapConfig.setUpdated(new Date());
if (updatedby != null) {
log.debug("updateLdapConfig :1: "+UsersDaoImpl.getInstance().getUser(updatedby));
ldapConfig.setUpdatedby(UsersDaoImpl.getInstance().getUser(updatedby));
}
log.debug("updateLdapConfig :2: "+updatedby);
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
ldapConfig = session.merge(ldapConfig);
ldapConfigId = ldapConfig.getLdapConfigId();
tx.commit();
PersistenceSessionUtil.closeSession(idf);
return ldapConfigId;