+++ /dev/null
-/* \r
-@VaadinApache2LicenseForJavaFiles@\r
- */\r
-package com.vaadin.data;\r
-\r
-/**\r
- * A Property that is capable of handle a transaction that can end in commit or\r
- * rollback.\r
- * \r
- * @param <T>\r
- * The type of the property\r
- * @author Vaadin Ltd\r
- * @version @version@\r
- * @since 7.0\r
- */\r
-public interface TransactionalProperty<T> extends Property<T> {\r
-\r
- /**\r
- * Starts a transaction.\r
- * \r
- * <p>\r
- * If the value is set during a transaction the value must not replace the\r
- * original value until {@link #commit()} is called. Still,\r
- * {@link #getValue()} must return the current value set in the transaction.\r
- * Calling {@link #rollback()} while in a transaction must rollback the\r
- * value to what it was before the transaction started.\r
- * </p>\r
- * <p>\r
- * {@link ValueChangeEvent}s must not be emitted for internal value changes\r
- * during a transaction. If the value changes as a result of\r
- * {@link #commit()}, a {@link ValueChangeEvent} should be emitted.\r
- * </p>\r
- */\r
- public void startTransaction();\r
-\r
- /**\r
- * Commits and ends the transaction that is in progress.\r
- * <p>\r
- * If the value is changed as a result of this operation, a\r
- * {@link ValueChangeEvent} is emitted if such are supported.\r
- * <p>\r
- * This method has no effect if there is no transaction is in progress.\r
- * <p>\r
- * This method must never throw an exception.\r
- */\r
- public void commit();\r
-\r
- /**\r
- * Aborts and rolls back the transaction that is in progress.\r
- * <p>\r
- * The value is reset to the value before the transaction started. No\r
- * {@link ValueChangeEvent} is emitted as a result of this.\r
- * <p>\r
- * This method has no effect if there is no transaction is in progress.\r
- * <p>\r
- * This method must never throw an exception.\r
- */\r
- public void rollback();\r
-}\r
\r
import com.vaadin.data.Item;\r
import com.vaadin.data.Property;\r
-import com.vaadin.data.TransactionalProperty;\r
import com.vaadin.data.Validator.InvalidValueException;\r
import com.vaadin.data.util.TransactionalPropertyWrapper;\r
import com.vaadin.tools.ReflectTools;\r
return;\r
}\r
for (Field<?> f : fieldToPropertyId.keySet()) {\r
- ((TransactionalProperty<?>) f.getPropertyDataSource())\r
+ ((Property.Transactional<?>) f.getPropertyDataSource())\r
.startTransaction();\r
}\r
try {\r
\r
// Commit the properties\r
for (Field<?> f : fieldToPropertyId.keySet()) {\r
- ((TransactionalProperty<?>) f.getPropertyDataSource()).commit();\r
+ ((Property.Transactional<?>) f.getPropertyDataSource())\r
+ .commit();\r
}\r
\r
} catch (Exception e) {\r
for (Field<?> f : fieldToPropertyId.keySet()) {\r
try {\r
- ((TransactionalProperty<?>) f.getPropertyDataSource())\r
+ ((Property.Transactional<?>) f.getPropertyDataSource())\r
.rollback();\r
} catch (Exception rollbackException) {\r
// FIXME: What to do ?\r