Package org.apache.empire.exceptions

Examples of org.apache.empire.exceptions.ObjectNotValidException


    public boolean loadFormData()
    {
        try {
            Record record = getRecord();
            if (record.isValid()==false)
                throw new ObjectNotValidException(record);
            // Load Data
            return setUpdateFields(record);

        } catch(Exception e) {
            // Action failed
View Full Code Here


        Object[] keyValues = getActionParamKey();
        if (isValid()==false || keyValues==null)
            throw new InvalidFormDataException();
        // Check Record
        if (record==null || !record.isValid())
            throw new ObjectNotValidException(record);
        // Check Key Length
        Column[] keyColumns = record.getKeyColumns();
        if (keyValues.length!=keyColumns.length)
            throw new InvalidFormDataException();
        // Copy values
View Full Code Here

            {   // get record object from session
                Record rec = getRecordFromSession();
                if (rec!=null && (rec instanceof DBRecord))
                {   // Check rowset
                    if (((DBRecord)rec).getRowSet()!=rowset)
                        throw new ObjectNotValidException(rec);
                    // Record restored
                    this.record = (DBRecord)rec;
                }
                // Record not found
                throw new ItemNotFoundException(rowset.getName());
View Full Code Here

        try {
            // Record is not valid
            if (record.isValid()==false)
            {  
                log.error("Cannot save changes: record ist not valid");
                throw new ObjectNotValidException(record);
            }
            // Update Record
            updateRecord(action.getConnection());
            // Save Record Key Info
            persistOnSession();
View Full Code Here

    protected void prepareInitRecord(DBRecord rec, Object rowSetData, boolean insert)
    {
        if (rec==null)
            throw new InvalidArgumentException("rec", rec);
        if (columns.size() < 1)
            throw new ObjectNotValidException(this);
        // Init
        rec.initData(this, rowSetData, insert);
    }
View Full Code Here

            throw new NotSupportedException(this, "updateRecord");
        // Check Arguments
        if (rec == null)
            throw new InvalidArgumentException("record", rec);
        if (rec.isValid()==false)
            throw new ObjectNotValidException(rec);
        if (conn == null)
            throw new InvalidArgumentException("conn", conn);
        // Get the new Timestamp
        String name = getName();
        Timestamp timestamp = (timestampColumn!=null) ? db.getUpdateTimestamp(conn) : null;
View Full Code Here

    @Override
    public synchronized void getSelect(StringBuilder buf)
    {       
        resetParamUsage();
        if (select == null)
            throw new ObjectNotValidException(this);
        // limit rows
        boolean usePreparedStatements = isPreparedStatementsEnabled();
        if (limitRows>=0)
        {   // add limitRows and skipRows wrapper
            buf.append("SELECT * FROM (");
View Full Code Here

            // found the join
            updateJoin = jex;
            break;
        }
        if (updateJoin==null)
            throw new ObjectNotValidException(this);
        Set<DBColumn> joinColumns = new HashSet<DBColumn>();
        updateJoin.addReferencedColumns(joinColumns);
        // using
        buf.append("\r\nUSING ");
        DBCommand inner = this.clone();
View Full Code Here

     * @return the insert into SQL-Command
     */
    protected String getInsertInto(DBTable table, DBColumnExpr[] select, List<DBColumnExpr> columns)
    {
        if (select == null)
            throw new ObjectNotValidException(this);
        // prepare buffer
        StringBuilder buf = new StringBuilder("INSERT INTO ");
        table.addSQL(buf, CTX_FULLNAME);
        // destination columns
        if (columns != null && columns.size() > 0)
View Full Code Here

     */
    public final String getInsertInto(DBTable table)
    {
        DBColumnExpr[] select = getSelectExprList();
        if (select == null || select.length < 1)
            throw new ObjectNotValidException(this);
        // Match Columns
        List<DBColumnExpr> inscols = new ArrayList<DBColumnExpr>(select.length);
        for (int i = 0; i < select.length; i++)
        {
            DBColumnExpr expr = select[i];
View Full Code Here

TOP

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

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.