Package org.apache.empire.exceptions

Examples of org.apache.empire.exceptions.InvalidArgumentException


     * @param the driver for which to enable or disable the relation
     */
    public String getEnableDisableStmt(boolean enable, DBDatabaseDriver driver)
    {
        if (driver==null)
            throw new InvalidArgumentException("driver", driver);
        // get Statement
        DBSQLScript script = new DBSQLScript();
        driver.addEnableRelationStmt(this, enable, script);
        if (script.getCount()!=1)
            throw new UnexpectedReturnValueException(script.getCount(), "driver.addEnableRelationStatement");
View Full Code Here


                // Format to SQL pattern
                 datetime = sqlFormat.format(dt);
            } catch (ParseException e) {
              // Invalid date
                log.error("Unable to parse date value "+datetime, e);
                throw new InvalidArgumentException("value", value);
            }
        }
        else
        {   // Format the date as string
            datetime = sqlFormat.format((Date)value);
View Full Code Here

    {
        this.clazz = clazz;
        this.cmd = cmd;
        // Invalid Argument
        if (cmd==null || cmd.hasSelectExpr())
            throw new InvalidArgumentException("cmd", cmd);
    }
View Full Code Here

     * @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

     * @param stmt the new statement for this index, or NULL to remove the statement
     */
    public void setStmt(int i, String stmt)
    {
        if (i<0 || i>=sqlCmdList.size())
            throw new InvalidArgumentException("index", i);
        // replace or remove statement
        if (stmt==null)
            sqlCmdList.remove(i);
        else
            sqlCmdList.set(i, stmt);
View Full Code Here

     * @param stmt the new statement for this index, or NULL to remove the statement
     */
    public void insertStmt(int i, String stmt)
    {
        if (stmt==null)
            throw new InvalidArgumentException("stmt", stmt);
        if (i<0 || i>sqlCmdList.size())
            throw new InvalidArgumentException("index", i);
        // replace or remove statement
        sqlCmdList.add(i, stmt);
    }
View Full Code Here

     */
    public static DBColumn findById(String columnId)
    {
        int i = columnId.lastIndexOf('.');
        if (i<0)
            throw new InvalidArgumentException("columnId", columnId);
        // rowset suchen
        String rsid = columnId.substring(0, i);
        DBRowSet rset = DBRowSet.findById(rsid);
        // column suchen
        String colname = columnId.substring(i+1);
View Full Code Here

     * @param driver the driver for which to enable or disable the relation
     */
    public String getEnableDisableStmt(boolean enable, DBDatabaseDriver driver)
    {
        if (driver==null)
            throw new InvalidArgumentException("driver", driver);
        // get Statement
        DBSQLScript script = new DBSQLScript();
        driver.addEnableRelationStmt(this, enable, script);
        if (script.getCount()!=1)
            throw new UnexpectedReturnValueException(script.getCount(), "driver.addEnableRelationStatement");
View Full Code Here

                // Format to SQL pattern
                 datetime = sqlFormat.format(dt);
            } catch (ParseException e) {
              // Invalid date
                log.error("Unable to parse date value "+datetime, e);
                throw new InvalidArgumentException("value", value);
            }
        }
        else
        {   // Format the date as string
            datetime = sqlFormat.format((Date)value);
View Full Code Here

     */
    public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script)
    {
        // The Object's database must be attached to this driver
        if (dbo==null || dbo.getDatabase().getDriver()!=driver)
            throw new InvalidArgumentException("dbo", dbo);
        // Check Type of object
        if (dbo instanceof DBDatabase)
        { // Database
            switch (type)
            {
View Full Code Here

TOP

Related Classes of org.apache.empire.exceptions.InvalidArgumentException

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.