BaseMITListItemManager.java :  » Issue-Tracking » scarab-0.21 » org » tigris » scarab » om » Java Open Source

Java Open Source » Issue Tracking » scarab 0.21 
scarab 0.21 » org » tigris » scarab » om » BaseMITListItemManager.java


package org.tigris.scarab.om;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.apache.torque.Torque;
import org.apache.torque.TorqueException;
import org.apache.torque.manager.AbstractBaseManager;
import org.apache.torque.manager.CacheListener;
import org.apache.torque.manager.MethodResultCache;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.SimpleKey;
import org.apache.torque.om.Persistent;
import org.apache.torque.util.Criteria;




/**
 * This class manages MITListItem objects.
 * This class was autogenerated by Torque  *
 * You should not use this class directly.  It should not even be
 * extended all references should be to MITListItemManager
 */
public abstract class BaseMITListItemManager
    extends AbstractBaseManager
{
    /** The name of the manager */
    protected static final String MANAGED_CLASS = "org.tigris.scarab.om.MITListItem";

    /** The name of our class to pass to Torque as the default manager. */
    protected static final String DEFAULT_MANAGER_CLASS
        = "org.tigris.scarab.om.MITListItemManager";

    /**
     * Retrieves an implementation of the manager, based on the settings in
     * the configuration.
     *
     * @return an implementation of MITListItemManager.
     */
    public static MITListItemManager getManager()
    {
        return (MITListItemManager)
            Torque.getManager(MITListItemManager.MANAGED_CLASS,
                MITListItemManager.DEFAULT_MANAGER_CLASS);
    }

    /**
     * Static accessor for the @see #getInstanceImpl().
     *
     * @return a <code>MITListItem</code> value
     * @exception TorqueException if an error occurs
     */
    public static MITListItem getInstance()
        throws TorqueException
    {
        return getManager().getInstanceImpl();
    }

    /**
     * Static accessor for the @see #getInstanceImpl(ObjectKey).
     *
     * @param id an <code>ObjectKey</code> value
     * @return a <code>MITListItem</code> value
     * @exception TorqueException if an error occurs
     */
    public static MITListItem getInstance(ObjectKey id)
        throws TorqueException
    {
        return getManager().getInstanceImpl(id);
    }

    /**
     * Static accessor for the @see #getCachedInstanceImpl(ObjectKey).
     * Loads <code>MITListItem</code> from cache, returns 
     * <code>null</code>, if instance is not in cache
     *
     * @param id an <code>ObjectKey</code> value
     * @return a <code>MITListItem</code> value
     * @exception TorqueException if an error occurs
     */
    public static MITListItem getCachedInstance(ObjectKey id)
        throws TorqueException
    {
        return getManager().getCachedInstanceImpl(id);
    }

    /**
     * Static accessor for the @see #getInstanceImpl(ObjectKey, boolean).
     *
     * @param id an <code>ObjectKey</code> value
     * @param fromCache if true, look for cached MITListItems before loading
     * from storage.
     * @return a <code>MITListItem</code> value
     * @exception TorqueException if an error occurs
     */
    public static MITListItem getInstance(ObjectKey id, boolean fromCache)
        throws TorqueException
    {
        return getManager().getInstanceImpl(id, fromCache);
    }

    /**
     * Static accessor for the @see #getInstanceImpl(ObjectKey).
     *
     * @param id an <code>ObjectKey</code> value
     * @return a <code>MITListItem</code> value
     * @exception TorqueException if an error occurs
     */
    public static MITListItem getInstance(Long id)
        throws TorqueException
    {
        return getManager().getInstanceImpl(SimpleKey.keyFor(id));
    }

    /**
     * Static accessor for the @see #getInstanceImpl(ObjectKey).
     *
     * @param id an <code>ObjectKey</code> value
     * @param fromCache if true, look for cached MITListItems before loading
     * from storage.
     * @return a <code>MITListItem</code> value
     * @exception TorqueException if an error occurs
     */
    public static MITListItem getInstance(Long id, boolean fromCache)
        throws TorqueException
    {
        return getManager().getInstanceImpl(SimpleKey.keyFor(id), fromCache);
    }

    /**
     * Static accessor for the @see #getInstancesImpl(List).
     *
     * @param ids a <code>List</code> value
     * @return a <code>List</code> value
     * @exception TorqueException if an error occurs
     */
    public static List getInstances(List ids)
        throws TorqueException
    {
        return getManager().getInstancesImpl(ids);
    }

    /**
     * Static accessor for the @see #getInstancesImpl(List, boolean).
     *
     * @param ids a <code>List</code> value
     * @param fromCache if true, look for cached MITListItems before loading
     * from storage.
     * @return a <code>List</code> value
     * @exception TorqueException if an error occurs
     */
    public static List getInstances(List ids, boolean fromCache)
        throws TorqueException
    {
        return getManager().getInstancesImpl(ids, fromCache);
    }

    public static void putInstance(Persistent om)
        throws TorqueException
    {
        getManager().putInstanceImpl(om);
    }

    public static void clear()
        throws TorqueException
    {
        getManager().clearImpl();
    }

    public static boolean exists(MITListItem obj)
        throws TorqueException
    {
        return getManager().existsImpl(obj);
    }

    public static MethodResultCache getMethodResult()
    {
        return getManager().getMethodResultCache();
    }

    public static void addCacheListener(CacheListener listener)
    {
        getManager().addCacheListenerImpl(listener);
    }

    /**
     * Creates a new <code>BaseMITListItemManager</code> instance.
     *
     * @exception TorqueException if an error occurs
     */
    public BaseMITListItemManager()
        throws TorqueException
    {
        setClassName("org.tigris.scarab.om.MITListItem");
    }

    /**
     * Get a fresh instance of a MITListItemManager
     */
    protected MITListItem getInstanceImpl()
        throws TorqueException
    {
        MITListItem obj = null;
        try
        {
            obj = (MITListItem) getOMInstance();
        }
        catch (Exception e)
        {
            throw new TorqueException(e);
        }
        return obj;
    }

    /**
     * Get a MITListItem with the given id.
     *
     * @param id <code>ObjectKey</code> value
     */
    protected MITListItem getInstanceImpl(ObjectKey id)
        throws TorqueException
    {
        return (MITListItem) getOMInstance(id);
    }

    /**
     * Get a MITListItem with the given id from the cache. Returns 
     * <code>null</code> if instance is not in cache
     *
     * @param id <code>ObjectKey</code> value
     */
    protected MITListItem getCachedInstanceImpl(ObjectKey id)
        throws TorqueException
    {
        return (MITListItem) cacheGet(id);
    }

    /**
     * Get a MITListItem with the given id.
     *
     * @param id <code>ObjectKey</code> value
     * @param fromCache if true, look for cached MITListItems before loading
     * from storage.
     */
    protected MITListItem getInstanceImpl(ObjectKey id, boolean fromCache)
        throws TorqueException
    {
        return (MITListItem) getOMInstance(id, fromCache);
    }

    /**
     * Gets a list of MITListItems based on id's.
     *
     * @param ids a List of <code>ObjectKeys</code> value
     * @return a <code>List</code> of MITListItems
     * @exception TorqueException if an error occurs
     */
    protected List getInstancesImpl(List ids)
        throws TorqueException
    {
        return getOMs(ids);
    }

    /**
     * Gets a list of MITListItems based on id's.
     *
     * @param ids a List of <code>ObjectKeys</code> value
     * @param fromCache if true, look for cached MITListItems before loading
     * from storage.
     * @return a <code>List</code> of MITListItems
     * @exception TorqueException if an error occurs
     */
    protected List getInstancesImpl(List ids, boolean fromCache)
        throws TorqueException
    {
        return getOMs(ids, fromCache);
    }

    /**
     * check for a duplicate project name
     */
    protected boolean existsImpl(MITListItem om)
        throws TorqueException
    {
        Criteria crit = MITListItemPeer
            .buildCriteria((MITListItem)om);
        return MITListItemPeer.doSelect(crit).size() > 0;
    }


    protected Persistent retrieveStoredOM(ObjectKey id)
        throws TorqueException
    {
        return MITListItemPeer.retrieveByPK(id);
    }

    /**
     * Gets a list of ModuleEntities based on id's.
     *
     * @param ids a <code>NumberKey[]</code> value
     * @return a <code>List</code> value
     * @exception TorqueException if an error occurs
     */
    protected List retrieveStoredOMs(List ids)
        throws TorqueException
    {
        return MITListItemPeer.retrieveByPKs(ids);
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.