Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: $ |
2 | package javax.persistence; |
||
3 | |||
4 | /** |
||
5 | * Thrown by the persistence provider when an optimistic locking conflict occurs. |
||
6 | * This exception may be thrown as part of an API call, a flush or at commit time. |
||
7 | * The current transaction, if one is active, will be marked for rollback. |
||
8 | * |
||
9 | * @author Emmanuel Bernard |
||
10 | */ |
||
11 | public class OptimisticLockException extends PersistenceException { |
||
12 | private Object entity; |
||
13 | |||
14 | public OptimisticLockException() { |
||
15 | super(); |
||
16 | } |
||
17 | |||
18 | public OptimisticLockException(Object entity) { |
||
19 | this.entity = entity; |
||
20 | } |
||
21 | |||
22 | public OptimisticLockException(Throwable cause) { |
||
23 | super( cause ); |
||
24 | } |
||
25 | |||
26 | public OptimisticLockException(String message) { |
||
27 | super( message ); |
||
28 | } |
||
29 | |||
30 | public OptimisticLockException(String message, Throwable cause) { |
||
31 | super( message, cause ); |
||
32 | } |
||
33 | |||
34 | public OptimisticLockException(String message, Throwable cause, Object entity) { |
||
35 | super( message, cause ); |
||
36 | this.entity = entity; |
||
37 | } |
||
38 | |||
39 | public Object getEntity() { |
||
40 | return entity; |
||
41 | } |
||
42 | } |