Examples of wherePrimaryKey()


Examples of org.apache.openjpa.jdbc.sql.Row.wherePrimaryKey()

        // if this is an update, this might be the only mod to the row, so
        // make sure the where condition is set
        if (action == Row.ACTION_UPDATE
            && row.getTable() == relMapping.getTable())
            row.wherePrimaryKey(rel);

        // update the inverse pointer with our oid value
        row.setForeignKey(fk, io, sm);
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.sql.RowImpl.wherePrimaryKey()

        // copy where conditions into new update that sets the fk
        update = new PrimaryRow(row.getTable(), Row.ACTION_UPDATE, null);
        if (row.getAction() == Row.ACTION_INSERT) {
            if (row.getPrimaryKey() == null)
                throw new InternalException(_loc.get("ref-cycle"));
            update.wherePrimaryKey(row.getPrimaryKey());
        } else {
            // Row.ACTION_UPDATE
            row.copyInto(update, true);
        }
        if (edge.getUserObject() instanceof ForeignKey) {
View Full Code Here

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

        // doesn't use oid as identifier
        Select sel = _sql.newSelect();
        while (mapping.getJoinablePCSuperclassMapping() != null)
            mapping = mapping.getJoinablePCSuperclassMapping();

        sel.wherePrimaryKey(oid, mapping, this);
        try {
            return sel.getCount(this) != 0;
        } catch (SQLException se) {
            throw SQLExceptions.getStore(se, _dict);
        }
View Full Code Here

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

        throws SQLException {
        Select sel = _sql.newSelect();
        if (!select(sel, mapping, subs, sm, null, fetch,
            JDBCFetchConfiguration.EAGER_JOIN, true, false))
            return null;
        sel.wherePrimaryKey(sm.getObjectId(), mapping, this);
        sel.setExpectedResultCount(1, false);
        return sel.execute(this, fetch);
    }

    /**
 
View Full Code Here

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

        while (base.getJoinablePCSuperclassMapping() != null)
            base = base.getJoinablePCSuperclassMapping();

        Select sel = _sql.newSelect();
        sel.select(base.getPrimaryKeyColumns());
        sel.wherePrimaryKey(sm.getObjectId(), base, this);
        Result exists = sel.execute(this, fetch);
        try {
            if (!exists.next())
                return false;
View Full Code Here

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

            //### object that only creates a real select when actually used?

            Select sel = _sql.newSelect();
            if (select(sel, mapping, Select.SUBS_EXACT, sm, fields, jfetch,
                EagerFetchModes.EAGER_JOIN, true, false)) {
                sel.wherePrimaryKey(sm.getObjectId(), mapping, this);
                res = sel.execute(this, jfetch, lockLevel);
                try {
                    if (!res.next())
                        return false;
                    load(mapping, sm, jfetch, res);
View Full Code Here

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

        boolean updateVersion)
        throws SQLException {
        Column[] cols = vers.getColumns();
        Select sel = store.getSQLFactory().newSelect();
        sel.select(cols);
        sel.wherePrimaryKey(sm.getObjectId(), vers.getClassMapping(), store);

        Result res = sel.execute(store, null);
        try {
            if (!res.next())
                return false;
View Full Code Here

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

        // doesn't use oid as identifier
        Select sel = _sql.newSelect();
        while (mapping.getJoinablePCSuperclassMapping() != null)
            mapping = mapping.getJoinablePCSuperclassMapping();

        sel.wherePrimaryKey(oid, mapping, this);
        if (_log.isTraceEnabled()) {
            _log.trace("exists: oid="+oid+" "+mapping.getDescribedType());
        }
        try {
            return sel.getCount(this) != 0;
View Full Code Here

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

            return fq.execute(sm, this, fetch);
        Select sel = _sql.newSelect();
        if (!select(sel, mapping, subs, sm, null, fetch,
            JDBCFetchConfiguration.EAGER_JOIN, true, false))
            return null;
        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);
View Full Code Here

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

        while (base.getJoinablePCSuperclassMapping() != null)
            base = base.getJoinablePCSuperclassMapping();

        Select sel = _sql.newSelect();
        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 {
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.