You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OptimisticLockException.java 1023B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.data.util.sqlcontainer;
  5. /**
  6. * An OptimisticLockException is thrown when trying to update or delete a row
  7. * that has been changed since last read from the database.
  8. *
  9. * OptimisticLockException is a runtime exception because optimistic locking is
  10. * turned off by default, and as such will never be thrown in a default
  11. * configuration. In order to turn on optimistic locking, you need to specify
  12. * the version column in your TableQuery instance.
  13. *
  14. * @see com.vaadin.addon.sqlcontainer.query.TableQuery#setVersionColumn(String)
  15. *
  16. * @author Jonatan Kronqvist / Vaadin Ltd
  17. */
  18. public class OptimisticLockException extends RuntimeException {
  19. private final RowId rowId;
  20. public OptimisticLockException(RowId rowId) {
  21. super();
  22. this.rowId = rowId;
  23. }
  24. public OptimisticLockException(String msg, RowId rowId) {
  25. super(msg);
  26. this.rowId = rowId;
  27. }
  28. public RowId getRowId() {
  29. return rowId;
  30. }
  31. }