Package net.frenopatico.citadels.manager.impl

Source Code of net.frenopatico.citadels.manager.impl.PlayerManagerExtensionsImpl

package net.frenopatico.citadels.manager.impl;

import lombok.extern.java.Log;
import net.frenopatico.citadels.manager.IPlayerManagerExtensions;
import net.frenopatico.citadels.model.Player;

import com.google.appengine.api.datastore.EntityNotFoundException;
import com.googlecode.objectify.Key;

/**
* Implementation class for any Player-specific methods that aren't already handled by ObjectifyGenericDAO<T>.
*/
@Log
public class PlayerManagerExtensionsImpl extends PlayerManagerImpl implements IPlayerManagerExtensions {
    /**
     * Delete a Player.
     *
     * @param player Player to delete.
     */
    @Override
    public final void delete( final Player player ) {
        // First do something special and specific for Player entities
        // ...

        // Now we can delete the entity from the datastore
        super.delete( player );
    }

    // Also have to override this version to control all delete() behavior
    @Override
    public final void delete( final Key<Player> entityKey ) {
        try {
            final Player player = this.get( entityKey );
            delete( player );
        } catch( EntityNotFoundException e ) {
            log.finest( "Entity not found." );
        }
    }

    /**
     * {@inheritDoc}
     */
    public void addCommentToPlayer( final Player essay, final String comment ) {
        // Implement the business logic specific to this unique method
        // ...
    }
}
TOP

Related Classes of net.frenopatico.citadels.manager.impl.PlayerManagerExtensionsImpl

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.