Package org.apache.openjpa.jdbc.sql

Examples of org.apache.openjpa.jdbc.sql.Select.execute()


                sel.select(sql.toString(), field);
                ClassMapping rel = getDefaultElementMapping(false);
                sel.whereForeignKey(getJoinForeignKey(rel),
                    sm.getObjectId(), field.getDefiningMapping(), store);

                Result res = sel.execute(store, fetch);
                try {
                    res.next();
                    coll.getChangeTracker().setNextSequence
                        (res.getInt(field) + 1);
                } finally {
View Full Code Here


        sel.wherePrimaryKey(sm.getObjectId(), mapping, this);
        sel.setExpectedResultCount(1, false);
        if (_log.isTraceEnabled()) {
            _log.trace("getInitializeStateResult: oid="+sm.getObjectId()+" "+mapping.getDescribedType());
        }
        Result result = sel.execute(this, fetch);
        cacheFinder(mapping, sel, fetch);
        return result;
    }

    /**
 
View Full Code Here

        sel.select(base.getPrimaryKeyColumns());
        sel.wherePrimaryKey(sm.getObjectId(), base, this);
        if (_log.isTraceEnabled()) {
            _log.trace("selectPrimaryKey: oid="+sm.getObjectId()+" "+mapping.getDescribedType());
        }
        Result exists = sel.execute(this, fetch);
        try {
            if (isEmptyResult(exists))
                return false;

            // record locked?
View Full Code Here

                EagerFetchModes.EAGER_JOIN, true, false)) {
                sel.wherePrimaryKey(sm.getObjectId(), mapping, this);
                if (_log.isTraceEnabled()) {
                    _log.trace("load: "+mapping.getDescribedType()+" oid: "+sm.getObjectId());
                }
                res = sel.execute(this, jfetch, lockLevel);
                try {
                   if (isEmptyResult(res))
                        return false;
                    load(mapping, sm, jfetch, res);
                } finally {
View Full Code Here

        sel.wherePrimaryKey(sm.getObjectId(), mapping, this);
        sel.setExpectedResultCount(1, false);
        if (_log.isTraceEnabled()) {
            _log.trace("getInitializeStateResult: oid="+sm.getObjectId()+" "+mapping.getDescribedType());
        }
        Result result = sel.execute(this, fetch);
        cacheFinder(mapping, sel, fetch);
        return result;
    }

    /**
 
View Full Code Here

        sel.select(base.getPrimaryKeyColumns());
        sel.wherePrimaryKey(sm.getObjectId(), base, this);
        if (_log.isTraceEnabled()) {
            _log.trace("selectPrimaryKey: oid="+sm.getObjectId()+" "+mapping.getDescribedType());
        }
        Result exists = sel.execute(this, fetch);
        try {
            if (isEmptyResult(exists))
                return false;

            // record locked?
View Full Code Here

                  EagerFetchModes.EAGER_JOIN, true, false)) {
                  sel.wherePrimaryKey(sm.getObjectId(), mapping, this);
                  if (_log.isTraceEnabled()) {
                      _log.trace("load: "+mapping.getDescribedType()+" oid: "+sm.getObjectId());
                  }
                  res = sel.execute(this, jfetch, lockLevel);
                  try {
                      if (isEmptyResult(res))
                          return false;
                      load(mapping, sm, jfetch, res);
                  } finally {
View Full Code Here

        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        if (!updateVersion && fetch.getReadLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) {
            fetch = (JDBCFetchConfiguration) fetch.clone();
            fetch.setReadLockLevel(MixedLockLevels.LOCK_NONE);
        }
        Result res = sel.execute(store, fetch);
        try {
            if (!res.next())
                return false;

            Object memVersion = sm.getVersion();
View Full Code Here

        Column col = field.getColumns()[0];
        Select sel = store.getSQLFactory().newSelect();
        sel.select(col);
        field.wherePrimaryKey(sel, sm, store);

        Result res = sel.execute(store, fetch);
        Object val = null;
        try {
            if (res.next())
                val = load(col, res, null);
        } finally {
View Full Code Here

        Select sel = store.getSQLFactory().newSelect();
        sel.select(_cols);
        field.wherePrimaryKey(sel, sm, store);

        Result res = sel.execute(store, fetch);
        Object val = null;
        try {
            if (res.next())
                val = HandlerStrategies.loadDataStore(field, res, null, _cols);
        } finally {
View Full Code Here

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.