Package com.scooterframework.common.exception

Examples of com.scooterframework.common.exception.InvalidOperationException


   * @param changedOnly
   *            true if only changed fields are included in SQL query
   */
  public void save(boolean changedOnly) {
    if (isFreezed())
      throw new InvalidOperationException(this, "saveChanged", "freezed");

    beforeSave();

    if (isNewRecord())
      create(changedOnly);
View Full Code Here


     *
     * <p>This method is useful when other process such as database trigger
     * may change the record.</p>
     */
    public void saveAndReload() {
        if (isFreezed()) throw new InvalidOperationException(this, "SaveAndReload", "freezed");
        save();
        reload();
    }
View Full Code Here

     *
     * <p>If a column name is protected, its data is unaffected. Use setData
     * method to set its data.</p>
     */
    public void clearAndSetData(Map<String, ?> inputDataMap) {
        if (isFreezed()) throw new InvalidOperationException(this, "clearAndSetData", "freezed");

        //filter out protected fields before setting data
        rowData.clearAndSetData(filterProtectedFields(inputDataMap));
    }
View Full Code Here

     *
     * <p>If a column name is protected, its data is unaffected. Use setData
     * method to set its data.</p>
     */
    public void setData(String nameValuePairs) {
        if (isFreezed()) throw new InvalidOperationException(this, "setData", "freezed");

        if (nameValuePairs == null || "".equals(nameValuePairs.trim())) return;

        setData(Converters.convertStringToMap(nameValuePairs));
    }
View Full Code Here

     * update() to save data to database.</p>
     *
     * <p>If a column name is protected, its data is unaffected.</p>
     */
    public void setData(Map<String, ?> inputDataMap) {
        if (isFreezed()) throw new InvalidOperationException(this, "setData", "freezed");

        if (inputDataMap == null || inputDataMap.size() == 0) return;

        beforeSetData();

View Full Code Here

     *
     * <p>This method does not save data to database. Use save() or create()
     * or update() to save data to database.</p>
     */
    public void setData(int index, Object columnData) {
        if (isFreezed()) throw new InvalidOperationException(this, "setData", "freezed");
        beforeSetData();
        rowData.setField(index, columnData);
        afterSetData(index);
    }
View Full Code Here

     *
     * <p>This method does not save data to database. Use save() or create() or
     * update() to save data to database.</p>
     */
    public void setData(String fieldName, Object fieldData) {
        if (isFreezed()) throw new InvalidOperationException(this, "setData", "freezed");
        beforeSetData();

        if (isExtraField(fieldName)) {
            setExtraFieldData(fieldName, fieldData);
        }
View Full Code Here

TOP

Related Classes of com.scooterframework.common.exception.InvalidOperationException

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.