From 959bd06303210e5c7fb63b35ddc839d3d419bbbc Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Thu, 22 Dec 2011 16:02:38 +0200 Subject: [PATCH] Remove TransactionalProperty that was replaced by Property.Transactional. --- .../vaadin/data/TransactionalProperty.java | 59 ------------------- .../vaadin/data/fieldgroup/FieldGroup.java | 8 +-- 2 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 src/com/vaadin/data/TransactionalProperty.java diff --git a/src/com/vaadin/data/TransactionalProperty.java b/src/com/vaadin/data/TransactionalProperty.java deleted file mode 100644 index 4bd3f5f0df..0000000000 --- a/src/com/vaadin/data/TransactionalProperty.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.data; - -/** - * A Property that is capable of handle a transaction that can end in commit or - * rollback. - * - * @param - * The type of the property - * @author Vaadin Ltd - * @version @version@ - * @since 7.0 - */ -public interface TransactionalProperty extends Property { - - /** - * Starts a transaction. - * - *

- * If the value is set during a transaction the value must not replace the - * original value until {@link #commit()} is called. Still, - * {@link #getValue()} must return the current value set in the transaction. - * Calling {@link #rollback()} while in a transaction must rollback the - * value to what it was before the transaction started. - *

- *

- * {@link ValueChangeEvent}s must not be emitted for internal value changes - * during a transaction. If the value changes as a result of - * {@link #commit()}, a {@link ValueChangeEvent} should be emitted. - *

- */ - public void startTransaction(); - - /** - * Commits and ends the transaction that is in progress. - *

- * If the value is changed as a result of this operation, a - * {@link ValueChangeEvent} is emitted if such are supported. - *

- * This method has no effect if there is no transaction is in progress. - *

- * This method must never throw an exception. - */ - public void commit(); - - /** - * Aborts and rolls back the transaction that is in progress. - *

- * The value is reset to the value before the transaction started. No - * {@link ValueChangeEvent} is emitted as a result of this. - *

- * This method has no effect if there is no transaction is in progress. - *

- * This method must never throw an exception. - */ - public void rollback(); -} diff --git a/src/com/vaadin/data/fieldgroup/FieldGroup.java b/src/com/vaadin/data/fieldgroup/FieldGroup.java index a5d676a5e9..062cdd5a42 100644 --- a/src/com/vaadin/data/fieldgroup/FieldGroup.java +++ b/src/com/vaadin/data/fieldgroup/FieldGroup.java @@ -15,7 +15,6 @@ import java.util.logging.Logger; import com.vaadin.data.Item; import com.vaadin.data.Property; -import com.vaadin.data.TransactionalProperty; import com.vaadin.data.Validator.InvalidValueException; import com.vaadin.data.util.TransactionalPropertyWrapper; import com.vaadin.tools.ReflectTools; @@ -408,7 +407,7 @@ public class FieldGroup implements Serializable { return; } for (Field f : fieldToPropertyId.keySet()) { - ((TransactionalProperty) f.getPropertyDataSource()) + ((Property.Transactional) f.getPropertyDataSource()) .startTransaction(); } try { @@ -421,13 +420,14 @@ public class FieldGroup implements Serializable { // Commit the properties for (Field f : fieldToPropertyId.keySet()) { - ((TransactionalProperty) f.getPropertyDataSource()).commit(); + ((Property.Transactional) f.getPropertyDataSource()) + .commit(); } } catch (Exception e) { for (Field f : fieldToPropertyId.keySet()) { try { - ((TransactionalProperty) f.getPropertyDataSource()) + ((Property.Transactional) f.getPropertyDataSource()) .rollback(); } catch (Exception rollbackException) { // FIXME: What to do ? -- 2.39.5