Package org.apache.empire.db.exceptions

Examples of org.apache.empire.db.exceptions.NoPrimaryKeyException


    protected void generateIdParams(DBRowSet rowset, List<?> items)
    {
        DBColumn[] keyCols = rowset.getKeyColumns();
        if (keyCols == null)
            throw new NoPrimaryKeyException(rowset);
        // generate all
        for (Object item : items)
        {
            Object[] key = getItemKey(keyCols, item);
            String idparam = getParameterMap().put(rowset, key);
View Full Code Here


        if (rec.isModified() == false)
            return; // Nothing to update
        // Must have key Columns
        DBColumn[] keyColumns = getKeyColumns();
        if (keyColumns==null)
            throw new NoPrimaryKeyException(this);
        // Get the fields and the flags
        Object[] fields = rec.getFields();
        // Get all Update Commands
        Map<DBRowSet, DBCommand> updCmds = new HashMap<DBRowSet, DBCommand>(3);
        for (int i = 0; i < columns.size(); i++)
View Full Code Here

    @Override
    public void deleteRecord(Object[] key, Connection conn)
    {
        // Check Primary key
        if (primaryKey == null )
            throw new NoPrimaryKeyException(this);

        // Check Columns
        DBColumn[] keyColumns = primaryKey.getColumns();
        if (key == null || key.length != keyColumns.length)
            throw new InvalidArgumentException("key", key);
View Full Code Here

     */
    protected void setKeyConstraints(DBCommand cmd, Object[] key)
    {
        // Check Primary key
        if (primaryKey == null )
            throw new NoPrimaryKeyException(this); // Invalid Argument
        // Check Columns
        DBColumn[] keyColumns = primaryKey.getColumns();
        if (key == null || key.length != keyColumns.length)
            throw new InvalidKeyException(this, key); // Invalid Argument
        // Add the key constraints
View Full Code Here

        {
            case DBRecord.REC_MODIFIED:
                if (primaryKey == null)
                { // Requires a primary key
                    log.error("updateRecord: "  + name + " no primary key defined!");
                    throw new NoPrimaryKeyException(this);
                }
                for (int i = 0; i < columns.size(); i++)
                { // search for the column
                  Object value = fields[i];
                  boolean modified = rec.wasModified(i);
View Full Code Here

     */
    protected void setKeyConstraints(DBCommand cmd, Object[] key)
    {
        // Check Primary key
        if (primaryKey == null )
            throw new NoPrimaryKeyException(this); // Invalid Argument
        // Check Columns
        DBColumn[] keyColumns = primaryKey.getColumns();
        if (key == null || key.length != keyColumns.length)
            throw new InvalidKeyException(this, key); // Invalid Argument
        // Add the key constraints
View Full Code Here

        {
            case DBRecord.REC_MODIFIED:
                if (primaryKey == null)
                { // Requires a primary key
                    log.error("updateRecord: "  + name + " no primary key defined!");
                    throw new NoPrimaryKeyException(this);
                }
                for (int i = 0; i < columns.size(); i++)
                { // search for the column
                  Object value = fields[i];
                  boolean modified = rec.wasModified(i);
View Full Code Here

        if (rec.isModified() == false)
            return; // Nothing to update
        // Must have key Columns
        DBColumn[] keyColumns = getKeyColumns();
        if (keyColumns==null)
            throw new NoPrimaryKeyException(this);
        // Get the fields and the flags
        Object[] fields = rec.getFields();
        // Get all Update Commands
        Map<DBRowSet, DBCommand> updCmds = new HashMap<DBRowSet, DBCommand>(3);
        for (int i = 0; i < columns.size(); i++)
View Full Code Here

    @Override
    public void deleteRecord(Object[] key, Connection conn)
    {
        // Check Primary key
        if (primaryKey == null )
            throw new NoPrimaryKeyException(this);

        // Check Columns
        DBColumn[] keyColumns = primaryKey.getColumns();
        if (key == null || key.length != keyColumns.length)
            throw new InvalidArgumentException("key", key);
View Full Code Here

TOP

Related Classes of org.apache.empire.db.exceptions.NoPrimaryKeyException

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.