Examples of InvalidArgumentException


Examples of org.apache.empire.exceptions.InvalidArgumentException

            // Forward only cursor?
            int type = rset.getType();
            if (type == ResultSet.TYPE_FORWARD_ONLY)
            {
                if (count < 0)
                    throw new InvalidArgumentException("count", count);
                // Move
                for (; count > 0; count--)
                {
                    if (!moveNext())
                        return false;
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @return true if the record has been initialized successfully or false otherwise
     */
    public void initRecord(DBRowSet rowset, DBRecord rec)
    {
      if (rowset==null)
          throw new InvalidArgumentException("rowset", rowset);
      // init Record
      rowset.initRecord(rec, this);
    }
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @param column a column object
     */
    protected void addColumn(DBTableColumn column)
    { // find column by name
        if (column==null || column.getRowSet()!=this)
            throw new InvalidArgumentException("column", column);
        if (getColumn(column.getName())!=null)
            throw new ItemExistsException(column.getName());
        // add now
        columns.add(column);
    }
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @param columns a array with one or more DBColumn objects
     */
    public void setPrimaryKey(DBColumn... columns)
    {
        if (columns==null || columns.length==0)
            throw new InvalidArgumentException("columns", columns);
        // All columns must belong to this table
        for (int i=0; i<columns.length; i++)
            if (columns[i].getRowSet()!=this)
                throw new InvalidArgumentException("columns["+String.valueOf(i)+"]", columns[i].getFullName());
        // Set primary Key now
        primaryKey = new DBIndex(name + "_PK", DBIndex.PRIMARYKEY, columns);
        indexes.add(primaryKey);
        primaryKey.setTable(this);
    }
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @param index the index to add
     */
    public DBIndex addIndex(DBIndex index)
    {
        if (index==null)
            throw new InvalidArgumentException("index", null);
        // Check index name
        String name = index.getName();
        for (DBIndex i : indexes)
        {
            if (i==index || name.equalsIgnoreCase(i.getName()))
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @return the Index object
     */
    public final DBIndex addIndex(String name, boolean unique, DBColumn... columns)
    {
        if (name==null || columns==null || columns.length==0)
            throw new InvalidArgumentException("name|columns", null);
        // add Index now
        DBIndex index = new DBIndex(name, (unique) ? DBIndex.UNIQUE : DBIndex.STANDARD, columns);
        addIndex(index);
        return index;
    }
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

            throw new NoPrimaryKeyException(this);

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

        // Delete References
        deleteAllReferences(key, conn);
       
        // Build SQL-Statement
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

            if (getDataType().isText())
            {
                setAttribute(DBCOLATTR_SINGLEBYTECHARS, Boolean.TRUE);
            }   
            else
                throw new InvalidArgumentException("size", size);
            // Remove sign
            size = Math.abs(size);
        }
        else if (attributes!=null && attributes.contains(DBCOLATTR_SINGLEBYTECHARS))
        {   // Remove single by chars attribute
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

    protected void getBeanProperty(Object bean, String property, Object value)
    {
        try
        {
            if (bean==null)
                throw new InvalidArgumentException("bean", bean);
            if (StringUtils.isEmpty(property))
                throw new InvalidArgumentException("property", property);
            /*
            if (log.isTraceEnabled())
                log.trace(bean.getClass().getName() + ": setting property '" + property + "' to " + String.valueOf(value));
            */
            /*
 
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @return the sql statement
     */
    public String getStmt(int i)
    {
        if (i<0 || i>=sqlCmdList.size())
            throw new InvalidArgumentException("index", i);
        // return statement
        return sqlCmdList.get(i);
    }
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.