Package org.salamanca.commands.user

Source Code of org.salamanca.commands.user.EliminarUsuario

package org.salamanca.commands.user;

import org.salamanca.commands.ICommand;
import org.salamanca.domain.User;
import org.salamanca.broker.BrokerServer;
import javax.jdo.PersistenceManager;

/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class EliminarUsuario implements ICommand{
User user;


    /**
     * InsertarUsuario
     *
     * @param user User
     */
    public EliminarUsuario(User user) {
    this.user=user;
    }

    /**
     * getCommandName
     *
     * @return String
     */
    public String getCommandName() {
        return this.getClass().getName();
    }

    /**
     * getBarDelimitedParameters
     *
     * @return String
     */
    public String getBarDelimitedParameters() {
        return user.getName();
    }

    /**
     * execute
     */
    public void execute() {
        PersistenceManager pm = BrokerServer.instance().getPMF().
                               getPersistenceManager();
       pm.currentTransaction().begin();
     User userPM=  (User)pm.getObjectById(javax.jdo.JDOHelper.getObjectId(user),true);
       pm.deletePersistent(userPM);

       pm.currentTransaction().commit();

    }
}
TOP

Related Classes of org.salamanca.commands.user.EliminarUsuario

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.