Package org.apache.empire.exceptions

Examples of org.apache.empire.exceptions.ObjectNotValidException


     * @param isModified modified or not
     */
    public void setModified(DBColumn column, boolean isModified)
    {  // Check valid
        if (state == State.Invalid)
            throw new ObjectNotValidException(this);
        // Check modified
        if (modified == null)
        {   // Init array
            modified = new boolean[fields.length];
            for (int j = 0; j < fields.length; j++)
View Full Code Here


     */
    @Override
    public Object getValue(int index)
    {   // Check state
        if (fields == null)
            throw new ObjectNotValidException(this);
        // Check index
        if (index < 0 || index>= fields.length)
            throw new InvalidArgumentException("index", index);
        // Special check for NO_VALUE
        if (fields[index] == ObjectUtils.NO_VALUE)
View Full Code Here

     * @return true if a valid value is supplied for the given field or false if value is {@link ObjectUtils#NO_VALUE
     */
    public boolean isValueValid(int index)
    {   // Check state
        if (fields == null)
            throw new ObjectNotValidException(this);
        // Check index
        if (index < 0 || index>= fields.length)
        {   // Index out of range
            throw new InvalidArgumentException("index", index);
        }
View Full Code Here

     * @param value the column value
     */
    protected void modifyValue(int i, Object value, boolean fireChangeEvent)
    {  // Check valid
        if (state == State.Invalid)
            throw new ObjectNotValidException(this);
        // Init original values
        if (modified == null)
        { // Save all original values
            modified = new boolean[fields.length];
            for (int j = 0; j < fields.length; j++)
View Full Code Here

     * @param value the value
     */
    public void setValue(int index, Object value)
    {
        if (state == State.Invalid)
            throw new ObjectNotValidException(this);
        if (index < 0 || index >= fields.length)
            throw new InvalidArgumentException("index", index);
        // Strings special
        if ((value instanceof String) && ((String)value).length()==0)
            value = null;
View Full Code Here

     * @param value the value
     */
    public final void setValue(Column column, Object value)
    {
        if (!isValid())
            throw new ObjectNotValidException(this);
        // Get Column Index
        setValue(getFieldIndex(column), value);
    }
View Full Code Here

     * @return true if the field is read only
     */
    public boolean isFieldReadOnly(Column column)
    {
        if (rowset==null)
            throw new ObjectNotValidException(this);
      if (getFieldIndex(column)<0)
            throw new InvalidArgumentException("column", column);
      // Check key column
        if (isValid() && !isNew() && rowset.isKeyColumn((DBColumn)column))
          return true;
View Full Code Here

     * @return true if the field is required
     */
    public boolean isFieldRequired(Column column)
    {
        if (rowset==null)
            throw new ObjectNotValidException(this);
      if (rowset.getColumnIndex(column)<0)
            throw new InvalidArgumentException("column", column);
        // from column definition
        return (column.isRequired());
    }
View Full Code Here

     * @param conn a valid connection to the database.
     */
    public void update(Connection conn)
    {
        if (!isValid())
            throw new ObjectNotValidException(this);
        if (!isModified())
          return; /* Not modified. Nothing to do! */
        // update
        rowset.updateRecord(this, conn);
    }
View Full Code Here

     * @param conn a valid connection to the database.
     */
    public void delete(Connection conn)
    {
        if (isValid()==false)
            throw new ObjectNotValidException(this);
        // Delete only if record is not new
        if (!isNew())
        {
            Object[] keys = rowset.getRecordKey(this);
            rowset.deleteRecord(keys, conn);
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.