Package org.apache.torque.om

Examples of org.apache.torque.om.Persistent


     *
     */

    public static Persistent newPersistentInstance()
    {
        Persistent obj = null;

        if(groupObject == null)
        {
            // This can happen if the Turbine wants to determine the
            // name of the anonymous user before the security service
View Full Code Here


     *
     */

    public static Persistent newPersistentInstance()
    {
        Persistent obj = null;

        if(roleObject == null)
        {
            // This can happen if the Turbine wants to determine the
            // name of the anonymous user before the security service
View Full Code Here

     *
     * @return the object primaryKey as an Object
     */
    public ObjectKey getPrimaryKey()
    {
        Persistent p = getPersistentObj();
        if(p != null)
        {
            return p.getPrimaryKey();
        }
        else
        {
            return null;
        }
View Full Code Here

     *
     */

    public static Persistent newPersistentInstance()
    {
        Persistent obj = null;

        if(permissionObject == null)
        {
            // This can happen if the Turbine wants to determine the
            // name of the anonymous user before the security service
View Full Code Here

     *         rethrown wrapped into a TorqueException.
     */
    protected Persistent getOMInstance(ObjectKey key, boolean fromCache)
        throws TorqueException
    {
        Persistent om = null;
        if (fromCache)
        {
            om = cacheGet(key);
        }

View Full Code Here

     * @param key the primary key of the object
     * @return the object from cache
     */
    protected Persistent cacheGet(Serializable key)
    {
        Persistent om = null;
        if (cache != null)
        {
            synchronized (this)
            {
                om = (Persistent) cache.get(key);
View Full Code Here

     *         rethrown wrapped into a TorqueException.
     */
    protected Persistent removeInstanceImpl(Serializable key)
        throws TorqueException
    {
        Persistent oldOm = null;
        if (cache != null)
        {
            try
            {
                synchronized (this)
View Full Code Here

            throw new TorqueException(om + "; class=" + om.getClass().getName()
                + "; id=" + om.getPrimaryKey() + " cannot be cached with "
                + getOMClass().getName() + " objects");
        }

        Persistent oldOm = null;
        if (cache != null)
        {
            try
            {
                synchronized (this)
View Full Code Here

            oms = new ArrayList(ids);
            List newIds = new ArrayList(ids.size());
            for (int i = 0; i < ids.size(); i++)
            {
                ObjectKey key = (ObjectKey) ids.get(i);
                Persistent om = null;
                if (fromCache)
                {
                    om = cacheGet(key);
                }
                if (om == null)
                {
                    newIds.add(key);
                }
                else
                {
                    oms.set(i, om);
                }
            }

            if (newIds.size() > 0)
            {
                List newOms = retrieveStoredOMs(newIds);
                for (int i = 0; i < oms.size(); i++)
                {
                    if (oms.get(i) instanceof ObjectKey)
                    {
                        for (int j = newOms.size() - 1; j >= 0; j--)
                        {
                            Persistent om = (Persistent) newOms.get(j);
                            if (om.getPrimaryKey().equals(oms.get(i)))
                            {
                                // replace the id with the om and add the om
                                // to the cache
                                oms.set(i, om);
                                newOms.remove(j);
View Full Code Here

TOP

Related Classes of org.apache.torque.om.Persistent

Copyright © 2018 www.massapicom. 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.